Table of Contents

Class PaletteDitherProcessor

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

Allows the consumption a palette to dither an image.

public sealed class PaletteDitherProcessor : IImageProcessor
Inheritance
PaletteDitherProcessor
Implements
Inherited Members

Constructors

PaletteDitherProcessor(IDither)

Initializes a new instance of the PaletteDitherProcessor class.

public PaletteDitherProcessor(IDither dither)

Parameters

dither IDither

The ordered ditherer.

PaletteDitherProcessor(IDither, ReadOnlyMemory<Color>)

Initializes a new instance of the PaletteDitherProcessor class.

public PaletteDitherProcessor(IDither dither, ReadOnlyMemory<Color> palette)

Parameters

dither IDither

The dithering algorithm.

palette ReadOnlyMemory<Color>

The palette to select substitute colors from.

PaletteDitherProcessor(IDither, float)

Initializes a new instance of the PaletteDitherProcessor class.

public PaletteDitherProcessor(IDither dither, float ditherScale)

Parameters

dither IDither

The ordered ditherer.

ditherScale float

The dithering scale used to adjust the amount of dither.

PaletteDitherProcessor(IDither, float, ReadOnlyMemory<Color>)

Initializes a new instance of the PaletteDitherProcessor class.

public PaletteDitherProcessor(IDither dither, float ditherScale, ReadOnlyMemory<Color> palette)

Parameters

dither IDither

The dithering algorithm.

ditherScale float

The dithering scale used to adjust the amount of dither.

palette ReadOnlyMemory<Color>

The palette to select substitute colors from.

Properties

Dither

Gets the dithering algorithm to apply to the output image.

public IDither Dither { get; }

Property Value

IDither

DitherScale

Gets the dithering scale used to adjust the amount of dither. Range 0..1.

public float DitherScale { get; }

Property Value

float

Palette

Gets the palette to select substitute colors from.

public ReadOnlyMemory<Color> Palette { get; }

Property Value

ReadOnlyMemory<Color>

Methods

CreatePixelSpecificProcessor<TPixel>(Configuration, Image<TPixel>, Rectangle)

Creates a pixel specific IImageProcessor<TPixel> that is capable of executing the processing algorithm on an Image<TPixel>.

public IImageProcessor<TPixel> CreatePixelSpecificProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle) where TPixel : unmanaged, IPixel<TPixel>

Parameters

configuration Configuration

The configuration which allows altering default behaviour or extending the library.

source Image<TPixel>

The source image. Cannot be null.

sourceRectangle Rectangle

The Rectangle structure that specifies the portion of the image object to draw.

Returns

IImageProcessor<TPixel>

The IImageProcessor<TPixel>

Type Parameters

TPixel

The pixel type.