Python – Find dominant/most common color in an image
Here’s code making use of Pillow and Scipy’s cluster package. For simplicity I’ve hardcoded the filename as “image.jpg”. Resizing the image is for speed: if you don’t mind the wait, comment out the resize call. When run on this sample image, it usually says the dominant colour is #d8c865, which corresponds roughly to the bright … Read more