GifImage.AdjustBrightness

GifImage.AdjustBrightness method

Adjusts the brightness of the image according to the specified brightness parameter. This method modifies the brightness of the entire image uniformly, enhancing or reducing the overall luminance to achieve the desired effect.

public override void AdjustBrightness(int brightness)
ParameterTypeDescription
brightnessInt32Brightness value.

Examples

The following example performs brightness 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 brightness value. The accepted values of brightness are in the range [-255, 255].
    gifImage.AdjustBrightness(50);
    gifImage.Save(dir + "sample.AdjustBrightness.png", new Aspose.Imaging.ImageOptions.PngOptions());
}

See Also