CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    357

    Pixel Image Recolouring

    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...

  2. #2
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: Pixel Image Recolouring

    Here what are the object types of Output and ColourChange ? Are they type of Colour class ?

  3. #3
    Join Date
    Nov 2006
    Posts
    357

    Re: Pixel Image Recolouring

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured