Resizing an Image in Python
This is another tool to add to your swiss-army knife collection. This function will resize an image, and rewrite the original file. It uses Anti-aliasing and defaults the image to 100% of the original quality. You can specify the width or height or both, maintaining the aspect ratio.
You will need Python Imaging Library (PIL) installed, if you haven’t already installed it.
>>> from PyImg import Resize >>> Resize('sample.jpg', 300) True
22 March 2010 in Python

Leave a comment
You must be logged in to post a comment.