Scaling pictures

buffi bjorn.kempen at gmail.com
Thu Dec 28 07:00:34 EST 2006


Kajsa Anka wrote:
> I would like some advice, I'm going to build a small app that will, among
> other things, scale images so that they can be published on a web site. I've
> never done any image processing in python before so I would like to ask what
> is the best way of doing this, I will not do anything else than scaling the
> images.
>
> I found the Python Imaging Library but before I dive into that I would like
> to know if there is a better way of doing this.

I prefer using imagemagick whenever I have to do anything related to
images.
http://www.imagemagick.org/script/index.php

Resizing an image would be something like this

import os

filename = "picture.png"
outputfile = "picture_resized.png"
new_size = "100x100"
os.system("convert %s -resize %s %s" % (filename, new_size, outputfile))




More information about the Python-list mailing list