AdjustGamma

GifImage.AdjustGamma method (1 of 2)

Gamma-correction of an image.

public override void AdjustGamma(float gamma)
ParameterTypeDescription
gammaSingleGamma for red, green and blue channels coefficient

Examples

The following example performs gamma-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 gamma coefficient for red, green and blue channels.
    gifImage.AdjustGamma(2.5f);
    gifImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}

See Also


GifImage.AdjustGamma method (2 of 2)

Gamma-correction of an image.

public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
ParameterTypeDescription
gammaRedSingleGamma for red channel coefficient
gammaGreenSingleGamma for green channel coefficient
gammaBlueSingleGamma for blue channel coefficient

Examples

The following example performs gamma-correction of a GIF image applying different coefficients for color components.

[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 individual gamma coefficients for red, green and blue channels.
    gifImage.AdjustGamma(1.5f, 2.5f, 3.5f);
    gifImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}

See Also