[Image-SIG] playing with CMYK images

jcupitt at gmail.com jcupitt at gmail.com
Mon Mar 2 23:58:04 CET 2009


2009/3/2 David Berthelot <d_berthelot at yahoo.com>:
> I ran into a similar problems with CMYK and I think it's because libjpeg doesn't interpret the CMYK data correctly (possibly stripping a color profile). This is easily verified using libjpeg standalone tools (like jpegtran that you can compile when compiling libjpeg).

The problem is probably that Photoshop does not follow the spec and
for some reason writes CMYK JPEGs with inverted inks.

Sadly there's not a (as far as I know) 100% way to spot Photoshop CMYK
JPEGs. If you think you might have a P/shop CMYK JPEG, you need to do
255-r, 255-g, 255-b, 255-k after loading it.

Here's a previous thread on the issue:

http://aspn.activestate.com/ASPN/Mail/Message/image-sig/3110476

> On the other hand, using ImageMagick python bindings (PythonMagick) worked fine (I assume ImageMagick doesn't rely on libjpeg).

IM does use libjpeg, but it guesses that if there's an Adobe app
marker it should invert inks. I don't think this is foolproof though.

John


More information about the Image-SIG mailing list