How can I optimize the histogram using Brightness and Contrast?
The Brightness and Contrast features, also known as Offset and Multiplier, allow you to shift and expand the pixel values of an image. They can be useful when the captured image does not make effective use of the available digital range.
For example, an 8-bit image provides pixel values from 0 to 255, but your application may produce pixel values primarily between 64 and 127. In this case, only part of the available digital range is being used.
How does Contrast affect the histogram?
Increasing the Contrast applies a multiplier to the pixel values and expands the range they occupy.
For example, if a contrast factor of 2 is applied to a pixel-value range of 64 to 127, the resulting range would be approximately 128 to 254.
This expands the range of the pixel values, but the image still does not make optimal use of the complete 0-255 range.
How does Brightness affect the histogram?
The Brightness setting, or Offset, shifts the pixel values up or down without expanding their range.
For example, the range 128 to 254 could be shifted downward by applying a negative Brightness value, resulting in approximately 64 to 190.
This creates additional headroom at the upper end of the digital range and can allow further contrast to be applied while making better use of the available range.
How should Brightness and Contrast be used together?
In simple terms:
-
Contrast expands the pixel-value range.
-
Brightness shifts the pixel-value range.
Used together, they can help optimize the histogram for a particular application by making more effective use of the available digital range.
Does Brightness or Contrast create additional image information?
No. Brightness and Contrast do not create additional image information. They only modify the existing pixel values.
Care must be taken to avoid clipping at either end of the available digital range. Pixel values that are shifted or expanded beyond the minimum or maximum value may be clipped, resulting in a loss of image information.
For an 8-bit image, this means avoiding excessive values below 0 or above 255.