Re: How to "TINT" bitmap?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



r(new) = MulDiv(r(spec),255 - r(old),255)
....

?

Christian

"Nobody" <nobody@xxxxxxx> wrote in message
news:DVQ7f.28554$fE5.2995@xxxxxxxxxxxxx
> Not sure if "TINT" is the effect I'm looking for, but I have a bitmap that
> is gray-ish, and I need to "TINT" it to the users selected color. So if
> they
> select blue as the foreground color, the gray-ish bitmap should now be
> blue-ish. I've tried a few formulas to calculate the new per pixel colors,
> and they do change the bitmap to the right color, but all the formulas
> I've
> tried seem to "flatten" the image. Ie: the bitmap looses its lighting
> effects.
>
> I've tried:
>
> r(new) = (r(orig) * r(specified color)) / 255;
> b...
> g...
>
> and:
>
> r(orig) += (r(speficied color) - r(orig)) * 5 /8;
>
>
> both seem to get the bitmap in the right color range, but both have that
> "flattening" problem where the bitmap was originally a shaded gray-ish,
> but
> now it seems to have lost the shading, or at least minimized it to the
> point
> where the image looks flat.
>
> I am positive the code to get/set the pixels is correct since I am
> successfully using it to apply other effects.
>
>


.



Relevant Pages

  • Re: Signature control - 1 BPP bitmap
    ... > as the foreground color on the destination surface, so if you blit a 1bpp ... then you'll see red and blue for the 1's/0's of the bitmap. ... > closest color match of the foreground/background colors to the DIB color ... Maybe Blt-ing to the DIBSection is still ...
    (microsoft.public.pocketpc.developer)
  • How To Transform Color?
    ... I have a bitmap file that I use as part of a skin in my GUI. ... the R,G,B values of the foreground color. ...
    (comp.graphics.algorithms)
  • Re: Bitmaps difference
    ... Apply a slight 'tint' to the different one, take each colour value from the ... User selects bitmap to compare to ... > different between default bitmap and user's selected bitmap. ...
    (microsoft.public.vc.mfc)