[Image-SIG] Converting from "CMYK" to "RGB"

Charles Cazabon charlesc-pyimagesig at pyropus.ca
Fri Jul 5 16:01:44 CEST 2013


Matti Viljamaa <mviljamaa at kapsi.fi> wrote:
> I'm trying to handle CMYK images by converting them to RGB. I'm using the
> following code snippet:
[...]
>     if(image.mode == 'CMYK' ): 
>         image.convert('RGB')

That would work, but you're throwing away the converted image and continuing
with the original CMYK one.  Image.convert() returns a new image and leaves
the original alone!

Charles
-- 
------------------------------------------------------------------
Charles Cazabon                   <charlesc-pyimagesig at pyropus.ca>
Software, consulting, and services available at http://pyropus.ca/
------------------------------------------------------------------


More information about the Image-SIG mailing list