Re-sizing images in Python?
johann at physics.berkeley.edu
Mon Jul 16 23:19:00 CEST 2001
> Look into PIL(python Imaging library) has all you need.
Exactly. Here's some sample code I wrote using PIL, just to give you
def resize (filename_in, filename_out, quality=None, size=(400,300)):
"Read a file from filename_in, resize, then output to filename_out."
im = Image.open (filename_in)
out = im.resize (size, Image.BILINEAR)
out.save (filename_out, quality=quality)
Johann Hibschman johann at physics.berkeley.edu
More information about the Python-list