AdjustGamma
Contents
[
Hide
]
DicomImage.AdjustGamma method (1 of 2)
Gamma-correction of an image.
public override void AdjustGamma(float gamma)
Parameter | Type | Description |
---|---|---|
gamma | Single | Gamma for red, green and blue channels coefficient |
Examples
The following example performs gamma-correction of a DICOM image.
[C#]
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set gamma coefficient for red, green and blue channels.
dicomImage.AdjustGamma(2.5f);
dicomImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
See Also
- class DicomImage
- namespace Aspose.Imaging.FileFormats.Dicom
- assembly Aspose.Imaging
DicomImage.AdjustGamma method (2 of 2)
Gamma-correction of an image.
public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Parameter | Type | Description |
---|---|---|
gammaRed | Single | Gamma for red channel coefficient |
gammaGreen | Single | Gamma for green channel coefficient |
gammaBlue | Single | Gamma for blue channel coefficient |
Examples
The following example performs gamma-correction of a DICOM image applying different coefficients for color components.
[C#]
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.dicom"))
{
Aspose.Imaging.FileFormats.Dicom.DicomImage dicomImage = (Aspose.Imaging.FileFormats.Dicom.DicomImage)image;
// Set individual gamma coefficients for red, green and blue channels.
dicomImage.AdjustGamma(1.5f, 2.5f, 3.5f);
dicomImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
See Also
- class DicomImage
- namespace Aspose.Imaging.FileFormats.Dicom
- assembly Aspose.Imaging