Re: Scaling pictures



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.

On Dec 28, 2:32 pm, "Ravi Teja" <webravit...@xxxxxxxxx> wrote:
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.Yes. Python Imaging Library (PIL) is the preferred Python way to do
this. The example is right in the documentation.http://www.pythonware.com/library/pil/handbook/image.htm

from PIL import Image
import glob, os

size = 128, 128

for infile in glob.glob("*.jpg"):
file, ext = os.path.splitext(infile)
im = Image.open(infile)
im.thumbnail(size, Image.ANTIALIAS)
im.save(file + ".thumbnail", "JPEG")

.



Relevant Pages

  • Re: Max files in unix folder from PIL process
    ... I am creating a python application that uses PIL to generate ... > thumbnails and sized images. ...
    (freebsd-questions)
  • Re: Image stats - going from Matlab to Python
    ... > I am working with images in python using PIL. ... I come from a MATLAB ...
    (comp.lang.python)
  • RE: using PIL for PCA analysis
    ... I know nothing about PIL, but you can do this using numpy and scipy ... matrix .(rows =num of images and cols=num of pixels) For this i need to ... this doublesnow represent a single image's pixels ...
    (comp.lang.python)
  • Re: Scaling pictures
    ... scale images so that they can be published on a web site. ... never done any image processing in python before so I would like to ask what ... I found the Python Imaging Library but before I dive into that I would like ... Python Imaging Library (PIL) is the preferred Python way to do ...
    (comp.lang.python)
  • Re: Fast Imaging for Webserver
    ... needs to process images to ... overlay them on a custom background ... I am using PIL 1.1.5 which I have custom compiled on my development ... Complete requests: 1000 ...
    (comp.lang.python)