[Image-SIG] Poor Image Quality When Resizing a GIF

Fredrik Lundh fredrik at pythonware.com
Wed Jan 9 09:28:41 CET 2008

Andy McCurdy wrote:

> Just started using PIL.  I'm attempting to resize a .gif image to a
> smaller size, keeping the height/width proportional.  The resize
> works, but the resulting image is very grainy.

try converting the image to "RGB" first, and use resize(ANTIALIAS) on 
the RGB image before converting it back to P.

(if you resize a "P" image as is, you can only use the NEAREST 
resampling method.  this works reasonably well for certain kinds of 
"graphics", but less so for images that are dithered.  for some kinds of 
images, smoothing the RGB image before resizing it might also help.)


More information about the Image-SIG mailing list