Table of Contents

Class QuantizerOptions

Namespace
SixLabors.ImageSharp.Processing.Processors.Quantization
Assembly
SixLabors.ImageSharp.dll

Defines options for quantization.

public class QuantizerOptions : IDeepCloneable<QuantizerOptions>
Inheritance
QuantizerOptions
Implements
Inherited Members
Extension Methods

Constructors

QuantizerOptions()

Initializes a new instance of the QuantizerOptions class.

public QuantizerOptions()

Properties

ColorMatchingMode

Gets or sets the color matching mode used for matching pixel values to palette colors. Defaults to Coarse.

public ColorMatchingMode ColorMatchingMode { get; set; }

Property Value

ColorMatchingMode

Dither

Gets or sets the algorithm to apply to the output image. Defaults to DefaultDither; set to null for no dithering.

public IDither? Dither { get; set; }

Property Value

IDither

DitherScale

Gets or sets the dithering scale used to adjust the amount of dither. Range 0..1. Defaults to MaxDitherScale.

public float DitherScale { get; set; }

Property Value

float

MaxColors

Gets or sets the maximum number of colors to hold in the color palette. Range 0..256. Defaults to MaxColors.

public int MaxColors { get; set; }

Property Value

int

TransparencyThreshold

Gets or sets the threshold at which to consider a pixel transparent. Range 0..1. Defaults to DefaultTransparencyThreshold.

public float TransparencyThreshold { get; set; }

Property Value

float

TransparentColorMode

Gets or sets the transparent color mode used for handling transparent colors when not using thresholding. Defaults to Preserve.

public TransparentColorMode TransparentColorMode { get; set; }

Property Value

TransparentColorMode

Methods

DeepClone()

Creates a new QuantizerOptions that is a deep copy of the current instance.

public QuantizerOptions DeepClone()

Returns

QuantizerOptions

The QuantizerOptions.