ChannelsProvider.Transparentize Method

Sets alpha values of pixels with a given color (and tolerant ones) to transparent.

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void Transparentize(
	Color backgroundColor,
	float threshold
)

Parameters

backgroundColor

Type: Aurigma.GraphicsMill.Color

threshold

Type: System.Single

The threshold in range [0, 1].

Remarks

This method is very useful when you need to blend two images and "upper" image does not have alpha channel, but it has a background color. For example, you draw a logo placed in the center of the image on white background. In this case you set bgColor to white color. You can also adjust a threshold parameter to make colors close to white color semi-transparent (to get smooth colors). Besides of that threshold is useful when background color is not completely uniform (for example, you loaded JPEG file with low quality).

Examples

C#
bitmap.Channels.Transparentize(RgbColor.LightBlue, 0.3f);

See Also

Reference