1

Possible Duplicate:
How can I get the average colour of an image

Say I'm making an application where a bitmap would be applied over user's photo. For the applied bitmap to look realistic, it had to have similar hue / saturation as in the user's photo.

So I wanted to ask, is there a way to get an average hue/sat or some other mean of color from the user photo? To use it as a coefficient to adjust hue/sat of the applied bitmap.

THanks.

Community
  • 1
  • 1
Roger Travis
  • 8,402
  • 18
  • 67
  • 94

1 Answers1

1

You could calculate the average hue/sat by looking at each of the pixels and simply calculating it yourself using the HSV methods in Color to get it from the RGB values. Since you would be doing it on a single image and not on a video preview it shouldn't be too hard, nor would it take too long on a phone to look over all the pixels.

digitaljoel
  • 26,265
  • 15
  • 89
  • 115