0

I would like to turn everyone's attention to this question before I begin as I want to do something similar: Getting the most common color of an image

Now, I have tested this and it is effective by filtering out the greys although does it really find us the most significant colours? It finds the most yes, although some greys do still show up.

I personally don't feel its the most efficient way. I have a colour histogram function, for both RGB and HSB and this divide up the space, but where do you go from here

Community
  • 1
  • 1
redrubia
  • 2,256
  • 6
  • 33
  • 47
  • 1
    What issue are you facing after you make your histogram? Can you show some samples that explain the issue? I'd say that if you have a histogram (either RGB or HSB or whatever) then you pick the bin in the histogram with the highest count, and this is the most common color. But I think this is not the answer you need. – jilles de wit Jul 23 '12 at 12:24
  • @jillesdewit Hi. Well the issue with choosing the larger bin is that it will be grays so websites have suggested I use a low-pass bandwidth filter to deal with this, but the application is slightly confusing me – redrubia Jul 23 '12 at 12:53

1 Answers1

2

If you want to find the most significant color you can do the following:

  1. Reduce number of colors in image. See this discussion - algorithm is the same.
  2. Cycle throught image and count each color.
  3. Find maximum of that array of colors. This will be your color.
Community
  • 1
  • 1
ArtemStorozhuk
  • 8,715
  • 4
  • 35
  • 53