Class GrayscaleExtensions
Defines extensions that allow the application of grayscale toning to an Image using Mutate/Clone.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class GrayscaleExtensions
Methods
| Edit this page View SourceGrayscale(IImageProcessingContext)
Applies Bt709 grayscale toning to the image.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Grayscale(IImageProcessingContext, GrayscaleMode)
Applies grayscale toning to the image with the given GrayscaleMode.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
GrayscaleMode | mode | The formula to apply to perform the operation. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Grayscale(IImageProcessingContext, GrayscaleMode, Rectangle)
Applies grayscale toning to the image.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
GrayscaleMode | mode | The formula to apply to perform the operation. |
Rectangle | rectangle | The Rectangle structure that specifies the portion of the image object to alter. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Grayscale(IImageProcessingContext, GrayscaleMode, float)
Applies grayscale toning to the image with the given GrayscaleMode using the given amount.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, float amount)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
GrayscaleMode | mode | The formula to apply to perform the operation. |
float | amount | The proportion of the conversion. Must be between 0 and 1. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Grayscale(IImageProcessingContext, GrayscaleMode, float, Rectangle)
Applies grayscale toning to the image using the given amount.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, float amount, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
GrayscaleMode | mode | The formula to apply to perform the operation. |
float | amount | The proportion of the conversion. 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 |
Grayscale(IImageProcessingContext, Rectangle)
Applies Bt709 grayscale toning to the image.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
Rectangle | rectangle | The Rectangle structure that specifies the portion of the image object to alter. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Grayscale(IImageProcessingContext, float)
Applies Bt709 grayscale toning to the image using the given amount.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, float amount)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
float | amount | The proportion of the conversion. Must be between 0 and 1. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Grayscale(IImageProcessingContext, float, Rectangle)
Applies Bt709 grayscale toning to the image using the given amount.
Declaration
public static IImageProcessingContext Grayscale(this IImageProcessingContext source, float amount, Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
IImageProcessingContext | source | The current image processing context. |
float | amount | The proportion of the conversion. 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 |