getcolors
im.getcolors() => a list of (count, color) tuples or None
im.getcolors(maxcolors) => a list of (count, color) tuples or None
(New in 1.1.5) Returns an unsorted list of (count, color) tuples,
where the count is the number of times the corresponding color occurs
in the image.
If the maxcolors value is exceeded, the method stops counting and
returns None. The default maxcolors value is 256. To make sure you get
all colors in an image, you can pass in size[0]*size[1] (but make sure
you have lots of memory before you do that on huge images).