Class PaletteDitherProcessor
Allows the consumption a palette to dither an image.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Processing.Processors.Dithering
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class PaletteDitherProcessor : IImageProcessor
Constructors
| Improve this Doc View SourcePaletteDitherProcessor(IDither)
Initializes a new instance of the PaletteDitherProcessor class.
Declaration
public PaletteDitherProcessor(IDither dither)
Parameters
Type | Name | Description |
---|---|---|
IDither | dither | The ordered ditherer. |
PaletteDitherProcessor(IDither, ReadOnlyMemory<Color>)
Initializes a new instance of the PaletteDitherProcessor class.
Declaration
public PaletteDitherProcessor(IDither dither, ReadOnlyMemory<Color> palette)
Parameters
Type | Name | Description |
---|---|---|
IDither | dither | The dithering algorithm. |
ReadOnlyMemory<Color> | palette | The palette to select substitute colors from. |
PaletteDitherProcessor(IDither, Single)
Initializes a new instance of the PaletteDitherProcessor class.
Declaration
public PaletteDitherProcessor(IDither dither, float ditherScale)
Parameters
Type | Name | Description |
---|---|---|
IDither | dither | The ordered ditherer. |
Single | ditherScale | The dithering scale used to adjust the amount of dither. |
PaletteDitherProcessor(IDither, Single, ReadOnlyMemory<Color>)
Initializes a new instance of the PaletteDitherProcessor class.
Declaration
public PaletteDitherProcessor(IDither dither, float ditherScale, ReadOnlyMemory<Color> palette)
Parameters
Type | Name | Description |
---|---|---|
IDither | dither | The dithering algorithm. |
Single | ditherScale | The dithering scale used to adjust the amount of dither. |
ReadOnlyMemory<Color> | palette | The palette to select substitute colors from. |
Properties
| Improve this Doc View SourceDither
Gets the dithering algorithm to apply to the output image.
Declaration
public IDither Dither { get; }
Property Value
Type | Description |
---|---|
IDither |
DitherScale
Gets the dithering scale used to adjust the amount of dither. Range 0..1.
Declaration
public float DitherScale { get; }
Property Value
Type | Description |
---|---|
Single |
Palette
Gets the palette to select substitute colors from.
Declaration
public ReadOnlyMemory<Color> Palette { get; }
Property Value
Type | Description |
---|---|
ReadOnlyMemory<Color> |
Methods
| Improve this Doc View SourceCreatePixelSpecificProcessor<TPixel>(Configuration, Image<TPixel>, Rectangle)
Creates a pixel specific IImageProcessor<TPixel> that is capable of executing the processing algorithm on an Image<TPixel>.
Declaration
public IImageProcessor<TPixel> CreatePixelSpecificProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)
where TPixel : struct, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
Image<TPixel> | source | The source image. Cannot be null. |
Rectangle | sourceRectangle | The Rectangle structure that specifies the portion of the image object to draw. |
Returns
Type | Description |
---|---|
IImageProcessor<TPixel> |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel type. |