Class ContrastExtensions
- Namespace
- SixLabors.ImageSharp.Processing
- Assembly
- SixLabors.ImageSharp.dll
Defines extensions that allow the alteration of the contrast component of an Image using Mutate/Clone.
public static class ContrastExtensions
- Inheritance
-
ContrastExtensions
- Inherited Members
Methods
Contrast(IImageProcessingContext, float)
Alters the contrast component of the image.
public static IImageProcessingContext Contrast(this IImageProcessingContext source, float amount)
Parameters
source
IImageProcessingContextThe current image processing context.
amount
floatThe proportion of the conversion. Must be greater than or equal to 0.
Returns
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, float, Rectangle)
Alters the contrast component of the image.
public static IImageProcessingContext Contrast(this IImageProcessingContext source, float amount, Rectangle rectangle)
Parameters
source
IImageProcessingContextThe current image processing context.
amount
floatThe proportion of the conversion. Must be greater than or equal to 0.
rectangle
RectangleThe Rectangle structure that specifies the portion of the image object to alter.
Returns
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.