--- cairo-ps-surface.c.org 2010-11-15 20:00:33.000000000 +0900 +++ cairo-ps-surface.c 2010-11-15 20:01:59.000000000 +0900 @@ -2370,11 +2370,12 @@ " /Width %d def\n" " /Height %d def\n" " /BitsPerComponent %d def\n" - " /Decode [ 0 1 0 1 0 1 ] def\n", + " /Decode [ %s ] def\n", info.num_components == 1 ? "DeviceGray" : "DeviceRGB", info.width, info.height, - info.bits_per_component); + info.bits_per_component, + info.num_components == 1 ? "0 1" : "0 1 0 1 0 1"); if (surface->use_string_datasource) { _cairo_output_stream_printf (surface->stream,