[Image-SIG] PIL Image.getcolors() returns None

Fredrik Lundh fredrik at pythonware.com
Tue Jul 15 13:25:37 CEST 2008


Guillaume Lathoud wrote:

> Hello, here is an issue with PIL 1.1.6 on a Windows XP platform:
> 
> import Image
> im = Image.open( 'pil-1.1.6-Image-getcolors.png' )
> im.show()  # Displays the image correctly.
> print im.getcolors()  # Bug: displays "None".

The quickest way to fix this bug is to double-check the documentation:

     http://effbot.org/tag/PIL.Image.Image.getcolors

Note the section that begins with "If the maxcolors value is exceeded, 
the method stops counting and returns None."

</F>



More information about the Image-SIG mailing list