Class BinaryThresholdExtensions
Defines extension methods to apply binary thresholding on an Image using Mutate/Clone.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class BinaryThresholdExtensions
Methods
| Improve this Doc View SourceBinaryThreshold(IImageProcessingContext, Single)
Applies binarization to the image splitting the pixels at the given threshold with Luminance as the color component to be compared to threshold.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, 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.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
Color | upperColor | The color to use for pixels that are above the threshold. |
Color | lowerColor | The color to use for pixels that are below the threshold |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, Color, Color, BinaryThresholdMode)
Applies binarization to the image splitting the pixels at the given threshold.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
Color | upperColor | The color to use for pixels that are above the threshold. |
Color | lowerColor | The color to use for pixels that are below the threshold |
BinaryThresholdMode | mode | Selects the value to be compared to threshold. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, Color, Color, BinaryThresholdMode, Rectangle)
Applies binarization to the image splitting the pixels at the given threshold.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
Color | upperColor | The color to use for pixels that are above the threshold. |
Color | lowerColor | The color to use for pixels that are below the threshold |
BinaryThresholdMode | mode | Selects the value to be compared to threshold. |
Rectangle | rectangle | The Rectangle structure that specifies the portion of the image object to alter. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, 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.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
Color | upperColor | The color to use for pixels that are above the threshold. |
Color | lowerColor | 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
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, BinaryThresholdMode)
Applies binarization to the image splitting the pixels at the given threshold.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, BinaryThresholdMode mode)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
BinaryThresholdMode | mode | Selects the value to be compared to threshold. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, BinaryThresholdMode, Rectangle)
Applies binarization to the image splitting the pixels at the given threshold.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, BinaryThresholdMode mode, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
BinaryThresholdMode | mode | Selects the value to be compared to threshold. |
Rectangle | rectangle | The Rectangle structure that specifies the portion of the image object to alter. |
Returns
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |
BinaryThreshold(IImageProcessingContext, Single, Rectangle)
Applies binarization to the image splitting the pixels at the given threshold with Luminance as the color component to be compared to threshold.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The image this method extends. |
Single | threshold | 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
Type | Description |
---|---|
IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. |