[Image-SIG] Lanczos interpolation

Franz Buchinger fbuchinger at gmail.com
Tue Jun 2 13:58:38 CEST 2009

A good old trick is to work with intermediate images: resize the image using
the Bilinear method and produce an intermediate image that is about 25%
larger than the final image.
Then you can downscale the intermediate image using Lanczos.

This should give a much better performance than working just with Lanczos,
especially for large downscaling ratios (e.g. 10 Megapixel JPEG -> 1024x768)
Image quality shouldn't be affected too much by this method.


2009/5/12 Fredrik Lundh <fredrik at pythonware.com>

> On Sun, May 10, 2009 at 12:45 PM, David Yan <davidyan6 at gmail.com> wrote:
> > I want to resize an image Lanczos interpolation but I haven't found any
> > python module that can do so.  Also, I'm not knowledgeable enough to
> write
> > one myself.  What's the best way I can do this?  I use PIL currently but
> the
> > resampling filters don't suit my needs (antialias is too slow, bilinear
> and
> > bicubic produce aliasing when downsampling).
> ANTIALIAS is a Lanczos interpolation written in C, so it's not
> entirely obvious to me how you expect a Python version to be faster...
> </F>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090602/8c62e348/attachment.htm>

More information about the Image-SIG mailing list