Histogram Tool
Histogram Tool
One of the most useful tools in any image processing program is the histogram tool. A histogram shows the
distribution (count) of the intensity values in an image. If you learn how to “read” a histogram, you can
understand what is going on in your image and get ideas for methods to correctly manipulate the image. With a
histogram, you can usually tell an original image from a processed image.
Greyscale Histograms
In the example shown, histogram A is of a low-contrast black & white
(8bit greyscale) image. Notice that the histogram does not use the full
width of the x-axis. There are no true blacks or whites in this image,
only mid-range grays. This is a “muddy” looking image.
A
Histogram B shows the image (after processing with Adobe
Photoshop) with much better contrast. The image uses most of the
available greyscale range from blacks to whites. Notice how the
histogram retains the same approximate shape as histogram A. There
are gaps in the continuous histogram that were created in this step
B
(Photoshop’s levels tool was used to stretch the histogram); however,
they do not show in this small histogram (see page 3). *
*
Over-exposing a device (e.g., CCD camera) causes problems in the
image that are similar to those caused by over-exposing film. In
certain areas of a film-based image, information is lost because of the
over-saturation of the film (e.g., outdoor photos where someone’s face C
Black White
has too much sunlight on it). Detection devices (e.g., cameras, photo-
multipliers) can be over-saturated and lose information as well. Another problem is that the images can also be
over-processed in software such that they lose information.
Histogram C shows what happens when the original image from A was over-processed in Adobe Photoshop
(brightness and contrast adjustment), although it could easily be from a piece of over-exposed film or an over-
saturated detector. The information represented by the far left and right sides of the histogram has now been
truncated (see the *, represented by a spike in the histogram at either 0 or 255). The general shape of the original
histogram is lost, roughly the top and bottom 20% of the intensity data has been pushed to the extremes, and (as
in histogram B) there are gaps in the histogram that do not show here.
NOTE: In Adobe Photoshop, a higher bit depth image will be displayed using an 8bit (0-255) scale (e.g., the
histogram in the LEVELS tool) and the adjustment tools will only reference the 0-255 values. We are not sure why
this is the case, as it means that a user cannot make as granular an adjustment to the image as they might want.
GIMP also uses only 8bit values in its histograms and adjustment tools. In FIJI/ImageJ the histograms use higher
bit depths on both the x-axis and in the adjustment tools, but the display is similar to that of Photoshop (data is
summarized or “binned” to make it fit onto the graph).
Color Histograms
Color can be a very complicated subject. All of the software we have mentioned here (Photoshop, GIMP,
FIJI/ImageJ) will display a 24bit color image histogram in one of two ways. You will usually be presented first with
a histogram that represents luminance (think of luminance as what the pixel brightness would be if the color
image were converted to greyscale). You can also use the software to show the histogram for each (red, green,
blue) color channel. These single color histograms can vary widely, depending on what the image itself looks like.
Histogram stretch
A stretch is a very basic image processing technique that can improve
image contrast. Remember to always perform image processing on a copy
of the original image. In almost every instance, a histogram stretch is not
required to be reported. (NOTE: histogram equalization, while sounding
similar, is a very different and more aggressive image processing
technique).
Using the Photoshop levels tool on data in histogram A, the black point
and white point triangles (located right under the histogram) were moved
One caution, the middle arrow (the grey colored one) adjusts the
image gamma. Gamma is a non-linear adjustment that can be helpful
to shift data from the darker or lighter parts of the image (where the
After a histogram stretch
human eye has some difficulty discriminating differences) into the
middle grey levels. Gamma is considered a reportable form of image
manipulation. In the example to the right, the gamma was adjusted
aggressively. The histogram shows that there are larger gaps on the
white end of the scale, and “spikes” (individual data points that were
added together) on the black end of the scale.
• Make sure that the microscope is properly aligned (see our handout on Köeller Illumination)
• Use only high-quality specimen preparations (i.e., no artifacts, with low non-specific background staining,
clean coverslips of the correct thickness, etc.)
• Use the full dynamic range of the image acquisition device without over-saturating (over-exposing) the
device.
Useful reference: Burger, W. and Burge, M.J. (2008) Histograms, in Digital Image Processing, Texts in Computer Science, Ch 4, 37-52,
Springer London http://www.springerlink.com/content/v534786r575lll14/
Mr. Cromey is grateful for the support he receives from the SWEHSC (P30-ES006694) and the UACC (P30-CA023074).
From the UA Microscopy Alliance - http://microscopy.arizona.edu/learn/printable-materials
©2017 The University of Arizona, Tucson, AZ (original 7/2000, updated 01/2018)