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 GrayscaleExtensionsMethods
| Improve this Doc 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 image this method extends. | 
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 image this method extends. | 
| 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 image this method extends. | 
| 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, Single)
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 image this method extends. | 
| GrayscaleMode | mode | The formula to apply to perform the operation. | 
| Single | amount | The proportion of the conversion. Must be between 0 and 1. | 
Returns
| Type | Description | 
|---|---|
| IImageProcessingContext | 
Grayscale(IImageProcessingContext, GrayscaleMode, Single, 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 image this method extends. | 
| GrayscaleMode | mode | The formula to apply to perform the operation. | 
| Single | 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 image this method extends. | 
| Rectangle | rectangle | The Rectangle structure that specifies the portion of the image object to alter. | 
Returns
| Type | Description | 
|---|---|
| IImageProcessingContext | 
Grayscale(IImageProcessingContext, Single)
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 image this method extends. | 
| Single | amount | The proportion of the conversion. Must be between 0 and 1. | 
Returns
| Type | Description | 
|---|---|
| IImageProcessingContext | 
Grayscale(IImageProcessingContext, Single, 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 image this method extends. | 
| Single | 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 |