0
votes

I'm unsure of the terminology here, so I'll explain by example. I have an icon image like this:

Icon

i.e. an alpha-blended image with a single hue, as well as black and white. I want to be able to programmatically do a color replacement to a specific color, but retain the blending.

For example:

var blueCar = ColorReplace(redCar, Color.Blue);

To produce:

Imgur

You get the idea! I want to do this with a specific target color rather than a HSL change as you'd do in something like Photoshop / Paint.NET.

I'll be using C# for this, preferably GDI+, but am open to using other free libraries if necessary.

1
This will be a multi-step process. First you need determine the base icon color, next you need to "unblend" your solid color from the icon. Once you have that you can substitute the new color.Mark Ransom
The base color will always be the same - red. It's the color substitution I'm having trouble with.Barguast

1 Answers

0
votes

I think you have to change the image pixel by pixel, as shown at CodeProject, though that is rather old. Sayse has created some sort of extension for bitmaps here that may be of use.