[wxPython-users] Open PIL image with less quality

Christopher Barker Chris.Barker at noaa.gov
Tue May 8 10:07:48 PDT 2007


Peter Damoc wrote:
> There are a lot of strategies to improve the speed but from what I know, 
> all of them rely on some kind of Thumbnail database that provides fast 
> access to the visual representation of the file.

There is another option, at least for jpeg.

Jpeg breaks the image down into 8x8 squares, and does nifty 
frequency-domain compression on each block. One result of that is that 
there is a single "DC" value for each block that represents the average 
color for that block. Some advanced libs can scan a file reading only 
that DC value, thus very quickly returning a scaled doen (by a factor of 
8 in each direction) version of the file.

I'm pretty sure the unix jpegtools (or jpegtran, or jpegcrop, or...) can 
do this. I don't know about PIL. If PIl doesn't there is ImageMagik, and 
at least one other Python-binding-to-a-image-lib out there.

-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