Reputation: 948
I am doing change color of my apple shown below:
to change all red colors to green and all yellow to orange. My problem is how to select all kind of red color and how to select all kind of yellow to apply new effect or color.
Any help please.
Thanks
Upvotes: 3
Views: 1368
Reputation: 53870
The easiest way to do this is to convert the RGB colors to HSB/HSV (Hue, Saturation, Brightness/Value). The hue value is the color.
For converting red to green, for instance, you'll want to figure out which numeric hue value represents red and which one represents green, then figure out a threshold. For every pixel where the hue is close to red (within your threshold), you move the hue to green.
Upvotes: 2