[Image-SIG] playing with CMYK images

David Berthelot d_berthelot at yahoo.com
Tue Mar 3 04:45:31 CET 2009

Thanks for the explanation, I followed your link to the thread but I couldn't find the attachement you mentioned in it (because I'd like to use your patch !).
Is PIL still maintained (considering the patch is 3 years old) ? Or is there a specific reason it's not included in PIL ?

----- Original Message ----
From: "jcupitt at gmail.com" <jcupitt at gmail.com>
Cc: image-sig <image-sig at python.org>
Sent: Monday, March 2, 2009 2:58:04 PM
Subject: Re: [Image-SIG] playing with CMYK images

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:


> 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.

Image-SIG maillist  -  Image-SIG at python.org


More information about the Image-SIG mailing list