cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding tones and tone manipulation for vibrant photos

CamCyclopedia
Active Level 6
Options

Smartphone cameras make capturing photos convenient and easy. Users can now capture photos anywhere and at any time. This flexibility in image capture means we often take photos in places poorly suited for photography, such as dark or bright environments. Camera engineers work hard to develop algorithms that run in your camera hardware to ensure that you get high-quality, vibrant photos, even when capturing in non-ideal situations.

CamCyclopedia_0-1671179176341.jpeg

Figure 1. This figure shows an image captured by a smartphone. The red, green, and blue color channels of this image are shown. We can convert the image to a luminance image to reveal the brightness at each pixel. An image histogram is a way of visualizing the tonal properties of the luminance image. The histogram represents the number of pixels in the image for each tonal value.

 

Tones and image histograms

One of the ways photos are improved is through tone manipulation. To understand tone manipulation, let’s first understand what an image tone is and how camera engineers visualize the tones in an image.

Images are represented as a two-dimensional grid of pixels, with each pixel composed of a red, green, and blue color. The combination of the red, green, and blue values produces the colors we see on our screens and in printed photos. Figure 1 shows an example of an image captured by a smartphone. The image’s red, green, and blue channels are also shown. We can also convert our input image to a luminance image by selectively averaging the red, green, and blue values at each pixel. The luminance image allows us to understand the image’s tonal properties. In particular, a tone refers to the brightness level of each pixel, ranging from its darkest value to its brightest value. Images use a fixed number of tonal levels, typically 0 to 255 tones per image. We can visualize the tones in an image using a special plot called an image histogram. An image histogram is a visual representation that shows the number of pixels in the image with each tonal value. Figure 1 shows an example of the image histogram of the luminance image. The horizontal axis of the image histogram represents the tones from darkest (0) to brightest (255). The vertical axis shows the number of pixels in the image with each tonal value.

CamCyclopedia_1-1671179176347.jpeg

Figure 2. (Left) shows an underexposed (dark image) and its corresponding histogram. The histogram reveals that the image lacks tones in the bright region. (Right) shows an overexposed (bright image) and its corresponding histogram. The image has very few dark pixels. By examining these images’ histograms, we can determine whether the image quality can be improved.

 

What does an image histogram tell us about image quality?

An image histogram reveals a lot about the quality of an image. For example, in non-ideal environments, our images often lack tones in dark or bright regions. For example, in Figure 2 (left), we see an underexposed dark image and its corresponding image histogram. The image was captured under a canopy of trees, resulting in a dark image. We can see in the image histogram that there are only a few bright tones. Even without seeing the actual image, we can predict this image will appear dark. Figure 2 (right) shows an overexposed bright image and its corresponding histogram. This image was captured in an environment with direct sunlight. The histogram reveals that there are much fewer dark tones than bright tones. Again, even without seeing the captured image, we can predict this image will appear overly bright with few shadows and dark regions. Both of these images would likely not be preferred by the smartphone owner.

CamCyclopedia_2-1671179176353.jpeg

Figure 3. (Left) shows the underexposed image from Figure 2 and its histogram. (Middle) A tone curve enhances the image by adjusting its tonal values. This tone curve specifies how tones in the input image should be adjusted. This particular tone curve is increasing (or brightening) the tonal values. (Right) shows the resulting output image after tone manipulation. The image looks visually better. We also see that the corresponding histogram now spans the full tonal range.

Making images better through tone manipulation

Your camera hardware can analyze the tonal properties of your image’s histogram and adjust the tones to enhance the image’s visual quality. An image’s tonal values are adjusted using a mechanism referred to as a tone curve. Figure 3 shows an example, where the underexposed image from Figure 2 is shown together with its histogram. This underexposed image will be the input to the image adjustment. In Figure 3 (middle), we see the tone curve as a 2D plot, where the horizontal axis of the plot represents the input tones, and the vertical axis represents the output tones. The tone curve specifies how to convert the tones in the input image to their new values in the output image. Based on the tone curve, we can see that all pixels in the input image with a tone value of 50 will have a tone value of 120 in the output image. The graph also shows that all input pixels with a tone value of 150 will be adjusted to have a tone value of 225 in the output image. The tone curve describes a tonal adjustment that increases (or brightens) the input tones in the image. The tone curve is typically designed to adjust the luminance image’s histogram. The tone curve is then applied to each red, green, and blue color channel of the input image to produce the output image. Figure 3 (right) shows the output image and its histogram after tone adjustment. Notice how the image looks more vivid. In addition, the histogram of the output image spans the full tonal range. 

CamCyclopedia_3-1671179176360.jpeg

Figure 4. (Left) shows the overexposed image from Figure 2 and its histogram. (Middle) A tone curve enhances the image by decreasing (or darkening) the tonal values. (Right) shows the resulting output image after tone manipulation. The image looks visually better. We also see that the corresponding histogram now spans the full tonal range.

 

Figure 4 shows another example of tonal adjustment using a tone curve, but this time applied to the overexposed image from Figure 2. In this example, the tone curve shown in Figure 4 (middle) has a different shape than the previous example because, for this image, we wish to darken the image. In particular, we can see that all pixels in the input image with a tone value of 100 will be adjusted to have a new tonal value of 30 in the output image. Pixels with an input tonal value of 200 will be adjusted to have a tonal value of 120 in the output image. This tone curve reduces (or darkens) the input tones in the image. Figure 4 (right) shows the resulting output image and its histogram after applying the tonal adjustment. The output image has much more detail and texture after the adjustment. As with the previous example, the histogram of the corrected image spans the full tonal range from 0 to 255.  

 

CamCyclopedia_4-1671179176366.jpeg

Figure 5. (Left) shows an input image that spans most of the tonal ranges. (Middle) shows an S-curve, which simultaneously darkens and brightness tonal values in the image. This type of tone curve helps to increase the contrast and texture in the image. (Right) shows the output image and its histogram.

Enhancing contrast through tone manipulation

The previous examples targeted images that lacked dark or bright tones due to under- and overexposure. Tone curve manipulation can enhance images even when the image already has a full tonal range. For example, Figure 5 shows an input image and its histogram. The image histogram spans most of the possible tones and does not look over- or underexposed. However, tone manipulation can still enhance the image’s visual quality. Figure 5 (middle) shows a tone curve commonly referred to as an S-curve because it resembles the letter S. To understand what the S-curve is doing to the tonal range, we first look at the middle tonal value of 128. This value does not change from the input to the output. However, all tone values below the middle tone are darkened. For example, an input tone of 50 will become 25 in the output. Conversely, all tones above the middle tone are brightened. For example, an input tone of 200 becomes 225 in the output. The S-curve adjusts the overall contrast by simultaneously darkening and brightening tones, producing a visually crisp and vibrant output image.  

 

Summary

Tone manipulation is a simple yet effective way to produce high-quality images. Tone curves can help fix problems related to over- and underexposure and serve as a method for contrast enhancement. Camera engineers spend a great deal of time and effort developing tone curves suitable for different environments. At capture time, your camera hardware examines the image’s histogram to determine an appropriate tone curve to apply. The next time you share a vibrant photograph with your family and friends, think of the camera engineer who worked hard to select the right tone curve for your photograph.