[wxPython-users] Open PIL image with less quality

Christopher Barker Chris.Barker at noaa.gov
Tue May 8 10:27:44 PDT 2007


Christopher Barker wrote:
> I'd send a note to the image-sig list -- someone there will probably 
> know, and they certainly will if it can be done with PIL.

According to this:

http://www.pythonware.com/library/pil/handbook/format-jpeg.htm\

"""
PIL reads JPEG, JFIF, and Adobe JPEG files containing "L", "RGB", or 
"CMYK" data. It writes standard and progressive JFIF files.

Using the draft method, you can speed things up by converting "RGB" 
images to "L", and resize images to 1/2, 1/4 or 1/8 of their original 
size while loading them. The draft method also configures the JPEG 
decoder to trade some quality for speed.
"""

So it looks like PIL can produced reduced quality images from jpegs on 
the fly. give it try -- you'll save memory, if not time, and I think 
you'll save time too.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list