PredefinedColorsQuantizerSystemDefault1BppPalette Method
Gets a
PredefinedColorsQuantizer instance that can quantize colors using the system default 1-bit palette.
This palette consists of the black and white colors.
Namespace: KGySoft.Drawing.ImagingAssembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
public static PredefinedColorsQuantizer SystemDefault1BppPalette(
Color32 backColor = default,
byte alphaThreshold = 128
)
Public Shared Function SystemDefault1BppPalette (
Optional backColor As Color32 = Nothing,
Optional alphaThreshold As Byte = 128
) As PredefinedColorsQuantizer
public:
static PredefinedColorsQuantizer^ SystemDefault1BppPalette(
Color32 backColor = Color32(),
unsigned char alphaThreshold = 128
)
static member SystemDefault1BppPalette :
?backColor : Color32 *
?alphaThreshold : byte
(* Defaults:
let _backColor = defaultArg backColor new Color32()
let _alphaThreshold = defaultArg alphaThreshold 128
*)
-> PredefinedColorsQuantizer
- backColor Color32 (Optional)
- Colors with alpha (transparency) will be blended with this color before quantizing.
The Color32.A field of the background color is ignored. This parameter is optional.
Default value: The default value of the Color32 type, which has the same RGB values as Color.Black. - alphaThreshold Byte (Optional)
- Specifies a threshold value for the Color32.A field, under which a quantized color
is considered completely transparent. Though the quantizer returned from this method never returns alpha colors, it can be relevant in some cases, for example when drawing a partially
transparent bitmap onto a solid background. The source pixels, whose alpha value is below the alphaThreshold will be skipped,
whereas alpha pixels with higher opacity will be blended with the specified backColor. This parameter is optional.
Default value: 128.
PredefinedColorsQuantizerA
PredefinedColorsQuantizer instance that can quantize colors using the system default 1-bit palette.
The returned PredefinedColorsQuantizer instance can return up to 2 colors.
This palette consists of the black and white colors.
To make sure that you use a black and white palette use the
BlackAndWhite method instead, which provides white threshold adjustment as well.
For more details and examples see the
Examples section of the
BlackAndWhite method.
This quantizer fits well for the Format1bppIndexed pixel format.