Predominant Color

Awhile back David wondered if there was a way to get the predominant color from an image, such as an album cover. I do this by resizing the image to 1 x 1 pixel and saving it. This causes the image to be redrawn, so you can then take the color value from that single pixel or you can resize the 1 pixel image back to say 200x200, and it will be a nice color swatch for the predominant color of the original image.

This is not a perfect solution, but for the intended purpose it is probably “good enough.” For extra credit, guess what color you will get from Miles Davis’ album “Kind of Blue.”

Please note that the efficacy of this has a large dependence upon the resizing algorithm applied. Some, but not all algorithms will give you an approximation, but an analytical approach on the original image’s colour utilisation would yield a more reliable result; but even there, you can have variations based on the basis of the analysis carried - e.g. HSV-mean#based vs. RGB-mean-based.

ToolBox Pro has a “Get Colour from Image” action. It an return the hex code or a color swatch.