SKImageInfoExtensionsGetMatchingQuantizer Method

Gets a PredefinedColorsQuantizer instance that fits for the specified imageInfo.

Definition

Namespace: KGySoft.Drawing.SkiaSharp
Assembly: KGySoft.Drawing.SkiaSharp (in KGySoft.Drawing.SkiaSharp.dll) Version: 9.0.0
C#
public static PredefinedColorsQuantizer GetMatchingQuantizer(
	this SKImageInfo imageInfo,
	SKColor backColor = default,
	byte alphaThreshold = 128
)

Parameters

imageInfo  SKImageInfo
The SKImageInfo to get a quantizer for.
backColor  SKColor  (Optional)
Colors with alpha (transparency), which are considered opaque will be blended with this color before quantization. The Alpha property of the background color is ignored. This parameter is optional.
Default value: The bitwise zero instance of SKColor, which has the same RGB values as Black.
alphaThreshold  Byte  (Optional)
Specifies a threshold value for the Alpha property, under which a quantized color is considered completely transparent. This parameter is optional.
Default value: 128.

Return Value

PredefinedColorsQuantizer
A PredefinedColorsQuantizer instance that is compatible with the specified imageInfo.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SKImageInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also