ImageHistogram
ImageHistogram[image]
plots a histogram of the pixel levels for each channel in image.
ImageHistogram[image,bspec]
uses bin specification bspec.
ImageHistogram[image,bspec,range]
plots the histogram of the pixel values in the given range.
Details and Options




- An image histogram is a graphical representation of the color distribution in an image.
- ImageHistogram works with arbitrary grayscale and multichannel 2D and 3D images.
- For RGB images, ImageHistogram by default displays the channels using red, green, and blue.
- Binning specification bspec can be any of the following:
-
n n equally spaced bins Automatic automatic choice of binning All return tally of all available pixel values "Byte" 256 levels after converting data values to a "Byte" type - By default, for binary images two bins are used; otherwise, 128 bins are used.
- The range can be of the following forms:
-
Automatic automatic ranges depending on the color space All include all values {All,max} include values below max {min,All} include values above min {min,max} include values between min and max - The following defaults are used for range depending on the image color space. The ranges are chosen to include the subspace of the "RGB" color space.
-
"Grayscale","RGB","CMYK","HSB" {0,1} "XYZ" {0,1} "LAB" {-1.13,1} "LCH" {0,1.3} "LUV" {-1.26,1.76} - ImageHistogram accepts options of ListPlot, with the following additions and changes:
-
Appearance Automatic detailed appearance of the histogram AspectRatio 1/3 ratio of height to width Axes False whether to draw axes Filling Axis how to fill in stems for each point Frame True whether to include a frame FrameTicks None frame ticks InterpolationOrder 0 the polynomial degree of curves used in joining data points Joined True whether to join bars Method "IncludeOutOfRange" method to use PlotRangePadding None how much to pad the range of values - Possible settings for Appearance are:
-
"RGB" show RGB channel values and overlapping colors "Separated" make separate histograms for each channel "Stacked" stack values for each channel "Transparent" show channels overlapping, using transparency - Possible settings for Method include:
-
"IncludeOutOfRange" values below range in first bin and values above range in last bin "ExcludeOutOfRange" do not count out-of-range values

Examples
open allclose allBasic Examples (3)
Scope (6)
Histogram of a grayscale image showing all distinct levels:
Use range specification All to plot the histogram from the minimum to maximum value in the image:
Use a range specification that includes negative values for plotting the histogram:
Options (10)
Appearance (2)
InterpolationOrder (2)
PlotRange (1)
Applications (1)
Properties & Relations (3)
Image histogram can also be computed using Histogram; however, it is slower:
Find the histogram distribution of an image:
ImageHistogram blends alpha channel with black:
Possible Issues (1)
Text
Wolfram Research (2008), ImageHistogram, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageHistogram.html (updated 2014).
CMS
Wolfram Language. 2008. "ImageHistogram." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/ImageHistogram.html.
APA
Wolfram Language. (2008). ImageHistogram. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageHistogram.html