« Prev Introduction | Depiction | Processing | Brightness | Noise | Warping | Illustrations Next »

Brightness Control

Every now and then, we notice that the photos we take are either too dark or too bright.  The brightness levels in these photos need to be adjusted to enhance their appearance.   Applying "Gain" and "Gamma" are two very common brightness adjutsment operations.

Gain: The brightness of an image can be changed by multiplying the color values (R, G and B) of every pixel by a constant number (α).  If α is greater than 1, then the color values increase, and the brightness of the image increases.  On the other hand, if α is less than 1, then the brightness of the image decreases.  This process is often called gain adjustment.  We can represent this opertaion concisely as a mathematical formula:

New value = α * Old value

Figure 5: Brightness adjustment

The interactive demo in Figure 5 illustrates the effect of changing the gain to adjust the brightness levels.  Try dragging the slider on the bar to the right (Gain > 1) to scale up the brightness. You will notice that all parts of the image get brighter -- the dark regions of the image get brighter and the bright regions become even brighter.  Likewise, you can drag the slider to the left to scale down the brightness.

Gamma: When we set the gain to be greater than 1, in Figure 5, we observe that while the boat becomes brighter, the sky becomes too bright.   What if we want to make only the dark regions brighter but not increase the brightness of the bright regions too much, or vice versa?  Such an adjustment is known as gamma adjustment and can be mathematically represented by the following equation:

New value = 255*(Old value/255)γ

Figure 6: Gamma adjustment

The effect of applying the gamma is usually not as intuitive as applying the gain. Figure 6 demonstrates how the brightness is affected due to the gamma operation.  At the top is a bar whose brightness varies uniformly from black (0) to white (255). The bottom bar represents the corresponding brightness values after applying the gamma.  At γ = 1, the New value = Old value. For γ>1, the value of a darker pixel will be mapped to a much higher value, while the value of a brighter pixel will only be slightly increased.  The effect on the image is that the dark regions are made a lot brighter, while the bright regions get only slighlty brighter.  Similarly, for γ<1, the bright part of the image is made a lot darker, while the dark part remains relatively the same.  To get a better idea, you can see the effect of gamma on an image by adjusting the slide bar in Figure 7.

Figure 7: Gamma adjustment

 

« Prev Introduction | Depiction | Processing | Brightness | Noise | Warping | Illustrations Next »