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.


Franz

2009/5/12 Fredrik Lundh <fred...@pythonware.com>

> On Sun, May 10, 2009 at 12:45 PM, David Yan <davidy...@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@python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to