ImageGear Professional v18.2 > API Reference Guide > Processing Component API Reference > Processing Component Objects > IGProcessingCtl Control > IGProcessingCtl Methods > AdjustContrast Method |
Allows the brightness and contrast of the image to be adjusted. Brightness and contrast are linear controls that affect the intensity of the image pixels. These controls are similar to the Brightness and Contrast controls on a typical television set.
Contrast is a multiplier and Brightness is an additive value. A Contrast of 2.0 will cause each pixel to take on twice the intensity that it originally had while 0.5 will divide each by 2. A Brightness value of 20.0 will cause each pixel's intensity to be increased by 20 and a -20 will decrease or darken each by 20. Pixel values are clipped to the 0 to 255 range. Once clipped the data is lost and can not be regenerated. A Brightness of 0.0 and a Contrast of 1.0 will cause no change to the image. A -1.0 Contrast with a Brightness of 0.0 can be used to invert the intensity range.
For 8-bit grayscale images there are 2 methods that can be used to adjust the contrast. The adjustment can be made to the actual pixel value or to the palette. Use ContrastOptions.Mode to determine which. For 4-bit and 8i images the contrast can only be applied to the palette and ContrastOptions.Mode is ignored. For 24-bit images the contrast can only be applied to the pixel values themselves since there is no palette.
This method takes into account the ROI settings of pPage object, that are accessible via the IGPage Object.ROI Property. By default ROI is set to the entire image.
AdjustContrast (ByVal pPage As IGPage, ByVal Contrast As Double,
ByVal Brightness As Double, ByVal Gamma As Double)
Name | Description |
---|---|
pPage | Reference to IGPage Object to which the contrast adjustment is applied. |
Contrast |
The range should be from -(2^bpc) to (2^bpc) to adjust the contrast, bpc being equal to the bits per channel. Here are two examples of how this works:
|
Brightness |
The range should be from -(2^bpc)+1 to (2^bpc)-1 to adjust the brightness, bpc being equal to the bits per channel. Here are two examples of how this works:
|
Gamma | Greater than 0.0. Usual range: 0.75 to 3.0 |
N/A
All
Image Processing and Effects.