[Image-SIG] Problem when resizing large JPEG to thumbnail

Fredrik Lundh fredrik at pythonware.com
Mon Sep 28 13:22:29 CEST 2009

On Tue, Sep 1, 2009 at 4:44 AM, Etienne Desautels <tiit at sympatico.ca> wrote:

> So after experimenting, I see 3 problems:
> 1. Resize with ANTIALIAS from a large JPEG to a small thumbnail give poor
> image quality.

This should work fine in 1.1.6; no time to look at your tests right
now, but I'll do that asap.

> 2. BICUBIC, when set, is not applied. Instead NEAREST is use.

The problem you're seeing is that PIL's BICUBIC filter has a fixed
size, and thus doesn't work well for large downsamplings (there's a
discussion about this in the documentation, iirc).  The ANTIALIAS
filter does not have that shortcoming.

> 3. Converting from TIFF CMYK to RGB shift the colors dramatically.

This is a bug in 1.1.6 and earlier (well, strictly speaking, it's a
old bug in Photoshop, but I guess we're not really in a position to
make them change their implementation ;-).  It's fixed in 1.1.7.
There's also a drop-in replacement JPEG plugin by Kevin Cazabon that
fixes this for earlier versions (in a somewhat roundabout way, due to
a bug in the core library that has also been fixed in 1.1.7); see:



More information about the Image-SIG mailing list