Skip to main content
2 of 4
added 50 characters in body
user avatar
user avatar

CMYK JPEGs extracted from PDF appear inverted

I am having to deal with CMYK JPEGs extracted from a PDF source. The PDFs were created with Photoshop.

The problem is that Photoshop stores JPEG CMYK data in PDF/EPS using "normal" values, whereas in standalone JPEGs it stores inverted values.

When the DCTDecode streams are extracted bytewise, the resulting JPEGs appear inverted. Is there any way to place a marker into the extracted .jpg file to make Photoshop open it with the proper encoding? The process must be lossless (not involve further entropy encoding).

The JPEGs already contain the APP14 marker, and removing it has no effect.

Below is a quote from the libjpeg docs:

"... it appears that Adobe Photoshop writes inverted data in CMYK JPEG files: 0 represents 100% ink coverage, rather than 0% ink as you'd expect. ... Photoshop 3.0 [and newer]... write uninverted YCCK in EPS/JPEG files... (But the data polarity used in bare JPEG files will not change...)"

user2677