Dominant color & PIL

Terry Hancock hancock at
Sun Jan 22 23:29:26 EST 2006

On Sun, 22 Jan 2006 21:07:45 +0100
Sebastjan Trepca <trepca at> wrote:
> I was wondering is it possible to find out which colour is
> dominant in an image using PIL?
> It would be very easy to create interesting mozaic images
> with that :)

Shrink it to one pixel, and get that pixel's value. ;-)

Seriously, that ought to do it.  Bear in mind that you need
to use the right sampling mode (IIRC, you want ANTIALIAS).


Terry Hancock (hancock at
Anansi Spaceworks

More information about the Python-list mailing list