[Image-SIG] dithering on Image.convert() from "RGB" to "P"

Bill Janssen janssen at parc.com
Mon Jan 11 18:18:02 CET 2010


I was just looking into why error diffusion was occurring in my images
when I went from RGB to P with a 140-color image.  Unexpected.  I see in
the code that Floyd-Steinberg error diffusion will be applied on
conversions from "RGB" to "P", regardless of whether it's needed, unless
the optional "dither" parameter is specified.  So I changed my code to
specify "dither=Image.NONE" where appropriate.

Would it make sense to modify that default behavior to dither only if
needed?  That is, when converting from "RGB" to "P", only dither if the
number of colors is greater than 256?

Bill


More information about the Image-SIG mailing list