Hi!
I just did a ReplaceTransparent and got a strange result:
The transparent pixels are correct replaced - ok.
Those pixels with an alpha channel with 1..254 are replaced with a
BGRAPixelTransparent! Not ok.
I Think the error came with the introduction of the TGenericUniversalBitmap.
Before that there were no problems.
A little bit of code:
procedure TForm1.Button5Click(Sender: TObject);
var Bulb, dest: TBGRAbitmap;
begin
Bulb := TBGRABitmap.Create ('./bulb-light-off.png');
dest := TBGRABitmap.Create (2*bulb.width, bulb.Height);
dest.PutImage(0,0,bulb,dmDrawWithTransparency);
bulb.ReplaceTransparent(CSSWhite);
//bulb.ReplaceColor (BGRAPixelTransparent,cssWhite); // same problem
dest.PutImage(Bulb.width,0,bulb,dmDrawWithTransparency);
dest.SaveToFile('./TwoBulbs.png');
bulb.Free;
dest.Free;
end;
And an image in the attachment.
Winni