procedure ReplaceExactColor(img: TImage32; oldColor, newColor: TColor32);
Replaces a color with another, but only where pixels exactly match oldColor.
Note: Be careful when using this procedure in antialiased drawings as oldColor will mostly remain where antialiasing has blended this with adjacent colors.
uses Img32, Img32.Extra, Img32.Fmt.PNG; ... img := TImage32.Create; img.LoadFromFile('beetle_aq.png'); //make aqua colored pixels transparent, but unlike EraseColor, //here there's no accommodation for blended colors ReplaceColor(img, clAqua32, clNone32); img.SaveToFile('beetle3.png'); img.Free;
Copyright ©2010-2023 Angus Johnson - Image32 4.8 - Help file built on 17 Jan 2025