Hi, I'm looking for an idea for getting the most representative color in a grid of pixels. There is any algorithm for this? I'm not sure if the most representative is one of the colors appearing in the grid of is the average af all the pixels better?
A:
Have a look at some color quantization algorithms. I found them to be the most effective method to generate palettes from photographs. Also, most image manipulation/processing libraries should have some fast quantization built in.
mwc
2010-02-22 16:17:26
A:
You are probably looking at "average" as percepted by human. First you need to change you colors representation in a color space that is specially designed to be "perceptually uniform" (for calculation of color "distances") L*a*b* link text Then, each color is a point in 3D color space. Now you can find the "center" of the cloud of points and this is the "most representative color".
Ross
2010-02-27 08:41:06
@Ross this sounds good, I'll try it.
Kiewic
2010-03-01 22:36:04