In photography, a histogram is a graph of the luminosity, or light levels, of an image. It tells the photographer about the detail captured. Luminosity is 8-bits so it has 256 (2 to the power of 8) different levels and these levels are spread across a histogram from the left, being pure black (0), to the right, being pure white (255). All the areas between the far left and far right fall between black and white.
Creating a Histogram
To create a histogram, scan every pixel of the image taking the average of the red, green and blue color channels. Pure white averages to 255 and pure black averages to 0. Pure red averages to 85, pure green to 85, pure blue to 85, pure yellow (red and green) to 170 and pure cyan (green and blue) to 170. These values — 0, 85, 170 and 255 — correlate to column numbers in the histogram. Yes, red, green and blue each get the same value because they have the same luminosity. Likewise, cyan, yellow and magenta (170) have the same luminosity. Less pure colors count, too. Colors like BRICK, which is red at 128, green at 64 and blue at 64, average to the luminosity of 85.
Comparing Images with Histograms
All of these images were shot at the lowest ISO and in 14-bit RAW for maximum dynamic range.
Recovering Images Using Histograms
In the following 3-stop under exposed image, its exposure has been corrected in post-processing. As can be seen, the image was able to be totally restored. This is why exposing for the highlights and recovering for the shadows works.
In the following 3-stop over exposed image, its exposure has been corrected in post-processing. As can be seen, the image was NOT able to be totally restored. This is why it is important to expose the image for the highlights, so as not to lose detail. This can be done with bracketing or by using a highlight-weighted meter.
RGB (Red, Green and Blue) Histograms
This works the same as a luminance histogram but it shows the detail in each color. This is information that can be lost during the luminance calculations detailed above, so a luminance histogram does not tell the whole story. Notice how the blue histogram shows information lost in the luminance histogram.
Trust and Know the Histogram
Histograms are unique to every image. The more they are used then the more they will be understood. Some images warrant lots of blacks and some warrant lots of whites while some warrant neither.
Shooting Into the Sun
Shooting into the sun can be tricky. Use the histogram in Live View or in an EVF, otherwise, bracket the shot liberally. Because the sun is so bright, the histogram will show lots of the white (the last column or right side of the histogram), no matter what.
Try the Histogram Utility on your images.