Class LightnessExtensions
Defines extensions that allow the alteration of the lightness component of an Image using Mutate/Clone.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class LightnessExtensions
Methods
| Edit this page View SourceLightness(IImageProcessingContext, float)
Alters the lightness component of the image.
Declaration
public static IImageProcessingContext Lightness(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 greater than or equal to 0. |
Returns
Type | Description |
---|---|
IImageProcessingContext |
Remarks
A value of 0 will create an image that is completely black. 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 lighter results.
Lightness(IImageProcessingContext, float, Rectangle)
Alters the lightness component of the image.
Declaration
public static IImageProcessingContext Lightness(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 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 |
Remarks
A value of 0 will create an image that is completely black. 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 lighter results.