I have some code that can convert a single color in a template image to some other color chosen by a user. For example, if red RGB(255,0,0) is the template color it is pretty straightforward to convert the red pixels to a new color RGB(r,g,b). But say my template image has a range of red gradients in it, e.g. the RGB value varies for each pixel in the template. Is there some formula or process I can use to convert each pixel in the template to something that looks consistent for the new color?
Thanks,
Kevin
I was able to figure this out with a good start from vulkanino. What I had to do was convert my template and new RGB colors to HLS format (hue, luminance, saturation). Then I checked each bit in the image to see if the hue setting was within the tolerance, and if so, applied the delta hue value to the new color for that bit. The luminance and saturation could be left alone. Then I converted the HLS format for the new color back to RGB format, and everything looked good.