I'm writing an iPhone app and need help in figuring out how to take an image and blend it into a single color. I assume I need to do a gaussian blend but am not sure if this is correct or how to do it if it is.
Do you have any suggestions, pointers to sample gaussian blend code snippets, or am I heading in the wrong directions to get from image to blended color image?
It doesn't appear I can do this with existing iPhone frameworks or are there private methods in public frameworks that will make this job easier?
So you want to take an image and "blend it into a single color". Are you trying to get the 'average color' for the image?
If so, using a Gaussian filter is perhaps overcomplicating it, since the output you require is simply a single RGB value. The easiest way to do this is to compute the average for each color channel (red, green and blue):
A Gaussian filter is a center-weighted filter, meaning that the pixel in the center of the filtering window is weighted more heavily than the others. If you want to blur an image, then this is appropriate, but for blending an entire image, equally weighting all pixels, as in the pseudo-code above, is just as effective.