[Image-SIG] Trying to achive better quality resizing images

Eric Woudenberg eaw@connactivity.connactivity.com
Tue, 05 Mar 2002 22:31:02 -0500


Klamer Schutte writes:

>The key is that the reduction in size does introduce aliasing in your
>output. The remedy against aliasing is to first low-pass filter the image
>before doing a reduction.
>
>The standard filter ImageFilter.SMOOTH in PIL does a fairly good job on
>low-pass filtering for a reduction in size of about a factor two. So
>the following sequence:

>Note that the OPTIMAL aliasing reduction is dependent on your application.
>- For having the ability to reconstruct back towards a larger image you
>  want to have frequency domain cutoff at Nyquist rate -- this is not in
>  PIL, and will give not so nice visual results.
>- For speed you might want to have a uniform filter. This is not available
>  in a fast version in PIL.
>- For nice visual results you want to have a Gaussian filter. A generic
>  Gaussian filter is not available in PIL.
>- As a fairly standard trade of you might want to have a small convolution
>  approaching a Gaussian. This is what ImageFilter.SMOOTH approaches for
>  a factor-two reduction in size.

Klamer,

Thanks for the good explanation.

I'm finding the same problem as Paulo, but in my case I can't do
factor-of-two reductions, my source images vary in size and my target
image is fixed (110x110pixels).

Given that batch thumbnail generation and rescaling are precisely the
sort of operations that PIL and Python are perfectly suited for,
wouldn't it make sense for PIL to be improved to render scaled images
with a quality similar to those produced by Photoshop, et al?

Thanks,
Eric Woudenberg