The goal is to change the color a particular part of an image dynamically in C#. For example, in the picture below, I want to change the color of the sleeve only:
You could use some sort of pixel matching technique; search the image pixel by pixel to find the area you want but this is not trivial.
My solution is basically to split the picture in different areas, the one that won’t suffer color change, and the one(s) that will, like this:
Now I can use the methods described in my other article, to swap the color of the picture I want.
Then, use the method described in this other article, to combine both pictures into one.
You can download the image files used in this example here