Convert image in it's dominant color

Dominant color of the captured image is detected- between red, blue and green. Entire image is converted into the dominant color and displayed at the end.