BlendBlueChannel

function BlendBlueChannel(bgColor, blueMask: TColor32): TColor32;


A callback function that can be passed as a parameter to the TImage32.CopyBlend method.
This function uses the blue channel of blueMask to modify the background color's opacity. Commonly blueMask represents a pixel in a fully opaque black and white image since the alpha channel in that image will be ignored.

uses Img32, Img32.Fmt.PNG;
...
img := TImage32.Create;
img.LoadFromFile('./lenna.png');
img2 := TImage32.Create;
img2.LoadFromFile('./back_white_blur.png');
img.CopyBlend(img2, img2.Bounds, 
  img.Bounds, BlendBlueChannel);
img.SaveToFile('./lenna_fading.png');
img.Free;
    
Before:
After:

See Also

TImage32.CopyBlend, BlendMask