Table of Contents

Class BinaryThresholdProcessor

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

Performs simple binary threshold filtering against an image.

public class BinaryThresholdProcessor : IImageProcessor
Inheritance
BinaryThresholdProcessor
Implements
Inherited Members

Constructors

BinaryThresholdProcessor(float)

Initializes a new instance of the BinaryThresholdProcessor class with Luminance as color component to be compared to threshold.

public BinaryThresholdProcessor(float threshold)

Parameters

threshold float

The threshold to split the image. Must be between 0 and 1.

BinaryThresholdProcessor(float, Color, Color)

Initializes a new instance of the BinaryThresholdProcessor class with Luminance as color component to be compared to threshold.

public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor)

Parameters

threshold float

The threshold to split the image. Must be between 0 and 1.

upperColor Color

The color to use for pixels that are above the threshold.

lowerColor Color

The color to use for pixels that are below the threshold.

BinaryThresholdProcessor(float, Color, Color, BinaryThresholdMode)

Initializes a new instance of the BinaryThresholdProcessor class.

public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode)

Parameters

threshold float

The threshold to split the image. Must be between 0 and 1.

upperColor Color

The color to use for pixels that are above the threshold.

lowerColor Color

The color to use for pixels that are below the threshold.

mode BinaryThresholdMode

The color component to be compared to threshold.

BinaryThresholdProcessor(float, BinaryThresholdMode)

Initializes a new instance of the BinaryThresholdProcessor class.

public BinaryThresholdProcessor(float threshold, BinaryThresholdMode mode)

Parameters

threshold float

The threshold to split the image. Must be between 0 and 1.

mode BinaryThresholdMode

The color component to be compared to threshold.

Properties

LowerColor

Gets the color to use for pixels that fall below the threshold.

public Color LowerColor { get; }

Property Value

Color

Mode

Gets the BinaryThresholdMode defining the value to be compared to threshold.

public BinaryThresholdMode Mode { get; }

Property Value

BinaryThresholdMode

Threshold

Gets the threshold value.

public float Threshold { get; }

Property Value

float

UpperColor

Gets the color to use for pixels that are above the threshold.

public Color UpperColor { get; }

Property Value

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.