Table of Contents

Class BinaryThresholdExtensions

Namespace
SixLabors.ImageSharp.Processing
Assembly
SixLabors.ImageSharp.dll

Defines extension methods to apply binary thresholding on an Image using Mutate/Clone.

public static class BinaryThresholdExtensions
Inheritance
BinaryThresholdExtensions
Inherited Members

Methods

BinaryThreshold(IImageProcessingContext, float)

Applies binarization to the image splitting the pixels at the given threshold with Luminance as the color component to be compared to threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of the image. Must be between 0 and 1.

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, Color, Color)

Applies binarization to the image splitting the pixels at the given threshold with Luminance as the color component to be compared to threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of 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

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, Color, Color, BinaryThresholdMode)

Applies binarization to the image splitting the pixels at the given threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of 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

Selects the value to be compared to threshold.

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, Color, Color, BinaryThresholdMode, Rectangle)

Applies binarization to the image splitting the pixels at the given threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of 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

Selects the value to be compared to threshold.

rectangle Rectangle

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

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, Color, Color, Rectangle)

Applies binarization to the image splitting the pixels at the given threshold with Luminance as the color component to be compared to threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of 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

rectangle Rectangle

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

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, BinaryThresholdMode)

Applies binarization to the image splitting the pixels at the given threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, BinaryThresholdMode mode)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of the image. Must be between 0 and 1.

mode BinaryThresholdMode

Selects the value to be compared to threshold.

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, BinaryThresholdMode, Rectangle)

Applies binarization to the image splitting the pixels at the given threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, BinaryThresholdMode mode, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of the image. Must be between 0 and 1.

mode BinaryThresholdMode

Selects the value to be compared to threshold.

rectangle Rectangle

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

Returns

IImageProcessingContext

The IImageProcessingContext.

BinaryThreshold(IImageProcessingContext, float, Rectangle)

Applies binarization to the image splitting the pixels at the given threshold with Luminance as the color component to be compared to threshold.

public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Rectangle rectangle)

Parameters

source IImageProcessingContext

The current image processing context.

threshold float

The threshold to apply binarization of the image. Must be between 0 and 1.

rectangle Rectangle

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

Returns

IImageProcessingContext

The IImageProcessingContext.