A color histogram in digital imaging is an accounting of the frequency of pixels within a given image that are the same color. This is often turned into a graph to help in analyzing and adjusting the balance within the image. Almost all photo editing software and a large number of digital cameras have a color histogram viewing or editing option. Editing an image by adjusting the color histogram can help to clarify and enhance the image by changing outlying colors to a more common color from within the image.
Each pixel in a digital image consists of three relevant values that determine its color — a red value, blue value and green value. These values can range from zero to 255, with zero being none and 255 being the maximum value. If all three values are zero, a pixel is black; if all three are 255, the pixel is white. A histogram determines how many pixels of each color are in the image. It also shows how many pixels within the colors are present by intensity.
There are many uses for a histogram. Most notably, it can be used in image editing to help make an image appear more professional by consolidating colors. If an image is made up of primarily midtones, then the color histogram can be adjusted so the upper and lower colors are changed to be either absolute white or black. This raises the contrast in an image and causes the visible midtones to appear more vibrant because they are framed by solid areas of blacks and whites. It also can reduce pixilation by turning areas of small differently colored pixels into solid areas of color.
On a digital camera, a color histogram can be displayed after an image is taken. This can be very useful, because the display on the camera — usually a liquid crystal display (LCD) — might not be able to accurately show the important elements of a picture. Viewing the histogram can help to determine whether an image has been overexposed or underexposed. Not every camera has a histogram option, however, and some that do provide only a luminance histogram that is not always effective.
Using a color histogram with a camera is not usually advisable except to check for overexposure, and even then it might not be accurate. Instead, an image from a camera should be checked with the histogram features of photo editing software and then compared to the histogram on the camera to visually calibrate how a camera is determining its color histogram. Some digital cameras do, however, provide a proper red-green-blue (RGB) histogram that can be very useful after a picture is taken.