views:

19

answers:

1

I have a bunch of sports team logos. What I want to do is find the color that is used for the highest percentage of pixels. So, for the patriots logo below, I would pick out the blue or #000f47 (white will not be an acceptable color), as this is used for the highest percentage of pixels. Obviously I can eyeball each image, use the color picker tool in Gimp/Photoshop, and determine the color. However, I would like to script this if possible.

I can use any format for the picture input. Would it be possible to read the raw bitmap file format and determine this way? What would be an easy format to read? Do any tools support this, like ImageMagick, etc?

alt text

Thanks

+2  A: 

If you're up for it then it's fairly straight forward to write your own image processor in C#; just run through the pixels, grab the R, G and, B values and increment a counter for each unique combination.

Having said that, if the image is anti-aliased then what you or I would eye-ball as being blue will be variations of the RGB and the processor would count them seperately. You might want to build in some allowable tollerances into the processor.

Just to be picky, isn't the most frequent pixel value in the image above white not blue?

Scott Rickman
Good point. Yes, it is white, but this will not be an allowable color.
Steve
It's a shame that Picasa Web Albums doesn't have the same colour filter as the Google image search otherwise that would be a potential solution.
Scott Rickman