2002.12.17 21:47 "CMYK JPEG's", by Dominic Smith

2002.12.18 03:14 "Re: CMYK JPEG's", by Leonard Rosenthol

I have some CMYK JPEG (.jpg, not TIFF JPEG) files which open ok in several recent PC packages (Paintshop 7 etc). But when I read them with libjpeg they are negative.

They are most likely created by Adobe software, which writes out "inverted" CMYK JPEGs. This problem is described in quite a lot of detail in the libjpeg and Ghostscript documentation - check them out!

I read that JPEG doesn't define the polarity of CMYK data, and that both interpretations (black is zero and white is zero) exist in the wild. Does libjpeg use white is zero?

Everybody except Adobe uses "white is zero"...

Also, has black is zero become the de facto (de Adobe?) standard? Should I invert the libjpeg output as a matter of course, and will this cover most/virtually all images I am likely to meet?

No, you need to actually check to see if the data comes from an Adobe application (presence of the Adobe APP1 tag) and then switch. HOWEVER, even that isn't 100% since there are some tools that will manipulate the data and leave the tags in place even if they aren't valid anymore :(.


Leonard Rosenthol                            <mailto:leonardr@lazerware.com>