[Image-SIG] PIL 1.1.6 and convert cmyk jpegs to rgb and writing png files

Kevin Cazabon kevin at cazabon.com
Fri Dec 12 17:55:42 CET 2008


A couple years ago, a few of us worked on adding multi-threading  
support to key routines in PIL - focusing on the ones that would most  
likely be CPU intensive or long duration operations.  It's a simple  
fix to release the GIL before starting the op, and re-acquire before  
returning - look at the C code for resize, for example.   We didn't  
get it implemented everywhere, but many of the "expensive" operations  
are now covered.  I'm sure Fred would gladly accept patches to add  
support elsewhere.

Kevin.


On 12 Dec 2008, at 11:34, Michael van Tellingen wrote:

> Hello,
>
> I'm currently writing a webapplication which processes images uploaded
> by users and i'm running into two problems:
> - Converting a CMYK jpeg image to RGB results in the wrong colors
> used, i've solved this by patching PIL with the
>   file attached to
> http://mail.python.org/pipermail/image-sig/2006-April/003871.html
>
> - It seems that writing a PNG image requires the GIL. I convert all
> uploaded images in a separate thread to PNG
>   images and while doing so my complete python application becomes
> really slow, I don't have this problem when
>   I convert it to JPEG or TIFF. Is this correct? And if so, how hard
> would it be to solve this problem?
>
> Thanks,
> Michael van Tellingen
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig



More information about the Image-SIG mailing list