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
| Edit this page View SourceBinaryThreshold(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.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProcessingContext | source | The current image processing context. |
| float | threshold | The threshold to apply binarization of the image. Must be between 0 and 1. |
Returns
| Type | Description |
|---|---|
| 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.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProcessingContext | source | The current image processing context. |
| float | 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 |
BinaryThreshold(IImageProcessingContext, float, 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 current image processing context. |
| float | 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 |
BinaryThreshold(IImageProcessingContext, float, 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 current image processing context. |
| float | 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 |
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.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Color upperColor, Color lowerColor, Rectangle rectangle)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProcessingContext | source | The current image processing context. |
| float | 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 |
BinaryThreshold(IImageProcessingContext, float, 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 current image processing context. |
| float | 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 |
BinaryThreshold(IImageProcessingContext, float, 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 current image processing context. |
| float | 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 |
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.
Declaration
public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Rectangle rectangle)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProcessingContext | source | The current image processing context. |
| float | 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 |