[Image-SIG] Dithering

Fredrik Lundh fredrik at pythonware.com
Sun Aug 28 22:27:30 CEST 2005


Christian M. Jensen wrote:

> I need to take a 256 level gray image down to 32 levels with nice
> dithering. What is the best process for doing that?

unless I'm missing something, I don't think you can do that in 1.1.5
(unless you want to do the dithering by hand).

the core library can do dithering both to fixed palettes and optimal
palettes, but PIL's convert method only exposes the "dither to web
palette" and "map to nearest N color" variants.

(if you want to do manual dithering, use quantize(32) on the source
image to get a reference image, take the difference between them,
and propagate the errors in some suitable way)

</F> 





More information about the Image-SIG mailing list