Class ContrastExtensions
Defines extensions that allow the alteration of the contrast component of an Image using Mutate/Clone.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class ContrastExtensionsMethods
| Improve this Doc View SourceContrast(IImageProcessingContext, Single)
Alters the contrast component of the image.
Declaration
public static IImageProcessingContext Contrast(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 greater than or equal to 0. | 
Returns
| Type | Description | 
|---|---|
| IImageProcessingContext | The IImageProcessingContext to allow chaining of operations. | 
Remarks
A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast.
Contrast(IImageProcessingContext, Single, Rectangle)
Alters the contrast component of the image.
Declaration
public static IImageProcessingContext Contrast(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 greater than or equal to 0. | 
| 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. | 
Remarks
A value of 0 will create an image that is completely gray. A value of 1 leaves the input unchanged. Other values are linear multipliers on the effect. Values of an amount over 1 are allowed, providing results with more contrast.