Bug 692332

Summary: Lab image results in strange Decode array and wrong colours in ps2write output
Product: Ghostscript Reporter: Ken Sharp <ken.sharp>
Component: PS WriterAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED FIXED    
Severity: normal CC: alex
Priority: P4    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---
Attachments: reduced specimen

Description Ken Sharp 2011-07-08 08:36:43 UTC
The test file IA3Z3476.pdf contains an image in an Lab colour space and when converted via ps2write this results in an image in RGB space, but with a very strange /Decode array and incorrect colours (with or without the array)

pdfwrite creates a correctly coloured RGB image, so this is particularly surprising.

I'll attach a much reduced PDF file (one image) which exhibits the problem.
Comment 1 Ken Sharp 2011-07-08 08:37:27 UTC
Created attachment 7652 [details]
reduced specimen

Reduced PDF file to exhibit the problem.
Comment 2 Alex Cherepanov 2011-08-30 05:15:13 UTC
Besides ps2write, the problem affects pdfwrite device. The latter is easier to
debug.

Incorrect colors can be observed at every compatibility level.
On level 1.3 and higher correct color can be restored by commenting out
   /Decode[0 100 -128 127 -128 127]
from the PDF file.

Level 1.2 has some other problems that cannot be fully fixed by the
above hack.
Comment 3 Ken Sharp 2011-11-26 10:32:15 UTC
(In reply to comment #2)
> Besides ps2write, the problem affects pdfwrite device. The latter is easier to
> debug.

I don't see this, I see that the image in the PDF file has an ICCBased colour space, but otherwise appears correct (there is no Decode array)

Presumably Alex must be using a different command line to me.
Comment 4 Ken Sharp 2012-02-06 07:55:56 UTC
Commit: ef2a4bfbf4f590635277299bf0e0d7aaea1f392b

http://ghostscript.com/pipermail/gs-cvs/2012-January/014097.html

resolves this by correctly converting images in CIEBased colour spaces.