Scaling pictures

cyberco cyberco at gmail.com
Sat Dec 30 08:06:04 EST 2006


cyberco wrote:
> PIL is certainly a fine option, but I noticed that the scaled images
> (scaled with the ANTIALIAS filter) are not as good as you can get with,
> say, Photoshop. Maybe I'm just expecting too much, but I wish I could
> choose a higher quality rescaling algorithm. PIL still rocks though.

Sorry, I should have checked the facts a little better: you can set the
quality of the compression when saving:

====================================
img = Image.open('old.jpg')
img.thumbnail((640,480), Image.ANTIALIAS)
img.save('new.jpg', quality=95)
====================================

Now PIL is definitely the way to go. :)




More information about the Python-list mailing list