Table of Contents

Struct ErrorDither

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

An error diffusion dithering implementation. http://www.efg2.com/Lab/Library/ImageProcessing/DHALF.TXT

public readonly struct ErrorDither : IDither, IEquatable<ErrorDither>, IEquatable<IDither>
Implements
Inherited Members

Constructors

ErrorDither(in DenseMatrix<float>, int)

Initializes a new instance of the ErrorDither struct.

public ErrorDither(in DenseMatrix<float> matrix, int offset)

Parameters

matrix DenseMatrix<float>

The diffusion matrix.

offset int

The starting offset within the matrix.

Fields

Atkinson

Applies error diffusion based dithering using the Atkinson image dithering algorithm.

public static readonly ErrorDither Atkinson

Field Value

ErrorDither

Burkes

Applies error diffusion based dithering using the Burks image dithering algorithm.

public static readonly ErrorDither Burkes

Field Value

ErrorDither

FloydSteinberg

Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm.

public static readonly ErrorDither FloydSteinberg

Field Value

ErrorDither

JarvisJudiceNinke

Applies error diffusion based dithering using the Jarvis, Judice, Ninke image dithering algorithm.

public static readonly ErrorDither JarvisJudiceNinke

Field Value

ErrorDither

Sierra2

Applies error diffusion based dithering using the Sierra2 image dithering algorithm.

public static readonly ErrorDither Sierra2

Field Value

ErrorDither

Sierra3

Applies error diffusion based dithering using the Sierra3 image dithering algorithm.

public static readonly ErrorDither Sierra3

Field Value

ErrorDither

SierraLite

Applies error diffusion based dithering using the Sierra Lite image dithering algorithm.

public static readonly ErrorDither SierraLite

Field Value

ErrorDither

StevensonArce

Applies error diffusion based dithering using the Stevenson-Arce image dithering algorithm.

public static readonly ErrorDither StevensonArce

Field Value

ErrorDither

Stucki

Applies error diffusion based dithering using the Stucki image dithering algorithm.

public static readonly ErrorDither Stucki

Field Value

ErrorDither

Methods

ApplyPaletteDither<TPaletteDitherImageProcessor, TPixel>(in TPaletteDitherImageProcessor, ImageFrame<TPixel>, Rectangle)

Transforms the image frame applying a dither matrix. This method should be treated as destructive, altering the input pixels.

public void ApplyPaletteDither<TPaletteDitherImageProcessor, TPixel>(in TPaletteDitherImageProcessor processor, ImageFrame<TPixel> source, Rectangle bounds) where TPaletteDitherImageProcessor : struct, IPaletteDitherImageProcessor<TPixel> where TPixel : unmanaged, IPixel<TPixel>

Parameters

processor TPaletteDitherImageProcessor

The palette dithering processor.

source ImageFrame<TPixel>

The source image.

bounds Rectangle

The region of interest bounds.

Type Parameters

TPaletteDitherImageProcessor

The type of palette dithering processor.

TPixel

The pixel format.

ApplyQuantizationDither<TFrameQuantizer, TPixel>(ref TFrameQuantizer, ImageFrame<TPixel>, IndexedImageFrame<TPixel>, Rectangle)

Transforms the quantized image frame applying a dither matrix. This method should be treated as destructive, altering the input pixels.

public void ApplyQuantizationDither<TFrameQuantizer, TPixel>(ref TFrameQuantizer quantizer, ImageFrame<TPixel> source, IndexedImageFrame<TPixel> destination, Rectangle bounds) where TFrameQuantizer : struct, IQuantizer<TPixel> where TPixel : unmanaged, IPixel<TPixel>

Parameters

quantizer TFrameQuantizer

The frame quantizer.

source ImageFrame<TPixel>

The source image.

destination IndexedImageFrame<TPixel>

The destination quantized frame.

bounds Rectangle

The region of interest bounds.

Type Parameters

TFrameQuantizer

The type of frame quantizer.

TPixel

The pixel format.

Equals(ErrorDither)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ErrorDither other)

Parameters

other ErrorDither

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(IDither?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(IDither? other)

Parameters

other IDither

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(ErrorDither, ErrorDither)

Compares the two ErrorDither instances to determine whether they are equal.

public static bool operator ==(ErrorDither left, ErrorDither right)

Parameters

left ErrorDither

The first source instance.

right ErrorDither

The second source instance.

Returns

bool

The bool.

operator ==(ErrorDither, IDither)

Compares the two ErrorDither instances to determine whether they are equal.

public static bool operator ==(ErrorDither left, IDither right)

Parameters

left ErrorDither

The first source instance.

right IDither

The second source instance.

Returns

bool

The bool.

operator ==(IDither, ErrorDither)

Compares the two ErrorDither instances to determine whether they are equal.

public static bool operator ==(IDither left, ErrorDither right)

Parameters

left IDither

The first source instance.

right ErrorDither

The second source instance.

Returns

bool

The bool.

operator !=(ErrorDither, ErrorDither)

Compares the two ErrorDither instances to determine whether they are unequal.

public static bool operator !=(ErrorDither left, ErrorDither right)

Parameters

left ErrorDither

The first source instance.

right ErrorDither

The second source instance.

Returns

bool

The bool.

operator !=(ErrorDither, IDither)

Compares the two ErrorDither instances to determine whether they are unequal.

public static bool operator !=(ErrorDither left, IDither right)

Parameters

left ErrorDither

The first source instance.

right IDither

The second source instance.

Returns

bool

The bool.

operator !=(IDither, ErrorDither)

Compares the two ErrorDither instances to determine whether they are unequal.

public static bool operator !=(IDither left, ErrorDither right)

Parameters

left IDither

The first source instance.

right ErrorDither

The second source instance.

Returns

bool

The bool.