I'm looking for a way trough javascript find the main color from a image. Probably trough some algorithm to cluster some areas.
Problem because if I use pixel, will count more pixels used. Ex. if i have brown and very colors next to brown, then a part with white. the main color could be white. And not want color average because could not represent the real color of the image.
Any suggestion of plugins, code to implement, websites . Thanks in advance
UPDATE
Something like this :
http://www.cssdrive.com/imagepalette/
There here something explaining, not sure if i can reuse the js code.