Re: How to "TINT" bitmap?
- From: "Christian Kaiser" <bchk@xxxxxx>
- Date: Thu, 27 Oct 2005 10:54:31 +0200
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.
>
>
.
- Prev by Date: Re: GetPixel from DIB
- Next by Date: RE: Metafile EXTTEXTOUT record structure?
- Previous by thread: RE: Easiest way to create metafiles?
- Next by thread: RE: Metafile EXTTEXTOUT record structure?
- Index(es):
Relevant Pages
|