ImageEn, unit iexBitmaps

TIEBitmap.RemoveAlphaChannel

TIEBitmap.RemoveAlphaChannel


Declaration


procedure RemoveAlphaChannel(Merge: boolean = false; BackgroundColor: TColor = clWhite);


Description


Removes the associated alpha channel.
When Merge is true, the specified BackgroundColor is merged with the semitransparent areas of the image (like a shadow).


Example


// Load a transparent PNG, remove the alpha channel (merging with a white background). Then save as a JPEG
aBmp := TIEBitmap.Create;
aBmp.Read('D:\TransparentImage.png');
aBmp.RemoveAlphaChannel( True, clWhite );
aBmp.Write('D:\Out.jpeg');
aBmp.free;