GifImageAdjustContrast Method
Adjusts the contrast.

Namespace: Aspose.Imaging.FileFormats.Gif
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 21.04
Syntax
public override void AdjustContrast(
	float contrast
)

Parameters

contrast
Type: SystemSingle
Contrast value (in range [-100; 100])
Exceptions
ExceptionCondition
ImageExceptionCan't change contrast. Frame index: " + frameIndex
Examples
The following example performs contrast correction of a GIF image.
[C#]

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

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

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