RasterImageAdjustContrast Method
Image contrasting

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 20.05
Syntax
public virtual void AdjustContrast(
	float contrast
)

Parameters

contrast
Type: SystemSingle
Contrast value (in range [-100; 100])
Examples
The following example performs contrast correction of an image.
[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.png"))
{
    Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;

    // Set the contrast value. The accepted values of contrast are in the range [-100f, 100f].
    rasterImage.AdjustContrast(50);
    rasterImage.Save(dir + "sample.AdjustContrast.png");
}
See Also