Bug 691477

Summary: Differences in tiff24nc and tiff32nc output
Product: Ghostscript Reporter: Marcos H. Woehrmann <marcos.woehrmann>
Component: ColorAssignee: Ken Sharp <ken.sharp>
Status: RESOLVED WORKSFORME    
Severity: normal CC: ghostpdl-bugs
Priority: P4    
Version: master   
Hardware: PC   
OS: All   
Customer: Word Size: ---
Attachments: screenshot.png
acrobat_rgb_Page_3.tiff
acrobat_cmyk_Page_3.tiff

Description Marcos H. Woehrmann 2010-07-19 01:37:23 UTC
Created attachment 6506 [details]
screenshot.png

Converting the file 29-07A.PS (found in tests_private/ps/ps3cet/) with head (r11519) to a 32 bit cmyk format (tiff32nc) results in a very different image on page 3 than converting to a 24 bit rgb format (tiff24nc), see attached screenshot.

This is somewhat of a progression, since before the icc_work branch merge the differences were even more pronounced (all of the gradient bars which contained any color were rendered entirely black).

Example command line2:

  bin/gs -sDEVICE=tiff24nc -o test24.tif ./29-07A.PS
  bin/gs -sDEVICE=tiff32nc -o test32.tif ./29-07A.PS

Opening the file in Adobe Acrobat 9.3.3 and saving as an RGB or CMYK TIFF results in the same image, which is an hybrid of Ghostscript output.  The first 6 bands on page 3 match Ghostscript RGB output and the final 4 bands match Ghostscript CMYK output, see attached files.
Comment 1 Marcos H. Woehrmann 2010-07-19 01:38:05 UTC
Created attachment 6507 [details]
acrobat_rgb_Page_3.tiff
Comment 2 Marcos H. Woehrmann 2010-07-19 01:38:25 UTC
Created attachment 6508 [details]
acrobat_cmyk_Page_3.tiff
Comment 3 Michael Vrhel 2011-11-04 05:20:09 UTC
Something is getting mixed up with respect to the color space when we get to the third page.  If I set first and last page to 3, the CMYK output is fine.
Comment 4 Ken Sharp 2023-05-17 13:46:33 UTC
After some consideration, and checking the current output against another PostScript interpreter, I do not believe there is a problem here. The output can be expected to be different depending on the device colour space, because the transfer function is applied in device space.

So if (as per the test) we define a colour image in, say, RGB it will be converted to the device space, say CMYK, before the transfer function is applied to it.

Also, after 12 years if there was a real problem here I think it would have been clear before.

Acrobat isn't really a good comparison here, we don't have sufficient control over the rendering to duplicate the PostScript result.