Click to See Complete Forum and Search --> : Pixel Image Recolouring


Grofit
July 26th, 2009, 05:18 PM
Hey,

Im just trying to do a simple recolour on an image. Basically i have an image and a custom control that has R/G/B sliders, i want to recolour the image pixel by pixel, pretty much like doing a colour overlay on it.

I did something like this in C++ years ago but i cant remember how i did it, i tried doing:

Output.R = Output.R * 0.5f + ColourChange.R * 0.5f;
Output.G = Output.G * 0.5f + ColourChange.G * 0.5f;
Output.B = Output.B * 0.5f + ColourChange.B * 0.5f;

But it just ends up washing it out completely...

vcdebugger
July 27th, 2009, 12:28 AM
Here what are the object types of Output and ColourChange ? Are they type of Colour class ?

Grofit
July 27th, 2009, 02:17 AM
Yep, although it comes out as an int i convert it into a colour then recolour and pass it back in.

Im thinking that maybe the problem is that im not storing the original image, just a static image that contains the changes, so after a while it will get washed out as it will lose 1/2 its colour every change. So i may need to update that, but im still not sure off top of my head if my method is correct...