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.
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 binsAutomatic automatic choice of binningAll 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 spaceAll include all values{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: [List of all options]
-
- 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
-
AspectRatio 1/3 ratio of height to widthImageMargins 0. the margins to leave around the graphicInterpolationOrder 0 the polynomial degree of curves used in joining data pointsMethod "IncludeOutOfRange" method to usePlotLayout "Overlaid" how to position dataPreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic
List of all options
Examples
open all close allBasic Examples (3)
Histogram of an RGB image:
Histogram of a grayscale image:
Histogram of a 3D volume:
Scope (6)
Specify the number of levels:
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:
Histogram of a binary image:
Use a range specification that includes negative values for plotting the histogram:
Histogram of a CMYK image:
Options (70)
Appearance (2)
Use additive colors to represent overlapping regions of histograms of an RGB image:
Show separate histograms for each color channel:
Stack the color channels vertically:
For non-RGB images, default plotting colors are used for all appearances:
Transparent histogram of a Lab image:
Stacked histogram:
Separated histogram:
AspectRatio (3)
By default, the function uses a fixed height to width ratio for the plot:
Make the height the same as the width with AspectRatio 1:
AspectRatio Full adjusts the height and width to tightly fit inside other constructs:
Axes (4)
By default, ImageHistogram uses a frame instead of axes:
Use axes instead of a frame:
Use AxesOrigin to specify where the axes intersect:
Turn each axis on individually:
AxesLabel (3)
No axes labels are drawn by default:
Place a label on the axis:
Specify axes labels:
AxesOrigin (2)
The position of the axes is determined automatically:
Specify an explicit origin for the axes:
AxesStyle (4)
Change the style for the axes:
Specify the style of each axis:
Use different styles for the ticks and the axes:
Use different styles for the labels and the axes:
Frame (5)
ImageHistogram uses a frame by default:
Use Frame False to turn off the frame:
Draw a frame on the left and right edges:
Draw a frame on the left and bottom edges:
Turn off the frame and use axes instead:
FrameLabel (4)
Place a label along the bottom frame of a plot:
Frame labels are placed on the bottom and left frame edges by default:
Place labels on each of the edges in the frame:
Use a customized style for both labels and frame tick labels:
FrameStyle (2)
Specify the style of the frame:
Specify the style for each frame edge:
FrameTicks (8)
Frame ticks are placed automatically by default:
Use a frame with no ticks:
Use frame ticks on the bottom edge:
Use All to include tick labels on all edges:
Place tick marks at specific positions:
Draw frame tick marks at the specified positions with specific labels:
Specify the lengths for tick marks as a fraction of the graphics size:
Use different sizes in the positive and negative directions for each tick mark:
Specify a style for each frame tick:
FrameTicksStyle (3)
By default, the frame ticks and frame tick labels use the same styles as the frame:
Specify an overall style for the ticks, including the labels:
Use different styles for the different frame edges:
ImageSize (7)
Use named sizes such as Tiny , Small , Medium and Large :
Specify the width of the plot:
Specify the height of the plot:
Allow the width and height to be up to a certain size:
Specify the width and height for a graphic, padding with space if necessary:
Setting AspectRatio Full will fill the available space:
Use maximum sizes for the width and height:
Use ImageSize Full to fill the available space in an object:
Specify the image size as a fraction of the available space:
InterpolationOrder (2)
By default, the histogram is plotted with interpolation of order :
Create a smooth histogram of an image:
Joined (1)
Render histogram using a stem plot:
Use a disjoint histogram:
Method (1)
Control how pixels outside of the histogram range are counted and displayed:
PlotLegends (4)
By default, no legend is shown:
Show legends for each plot:
Specify custom legends:
Using Appearance "RGB", there are seven segments and therefore legends to show:
PlotRange (1)
PlotTheme (3)
Use a theme minimum styling:
Add horizontal grid lines to the plot:
Use a theme with dark background in a high-contrast color scheme:
Ticks (7)
Ticks are placed automatically in each chart:
Use Ticks None to draw axes without any tick marks:
Specify tick spacings:
Place tick marks at specific positions:
Draw tick marks at the specified positions with the specified labels:
Specify the lengths for ticks as a fraction of graphics size:
Use different sizes in the positive and negative directions for each tick:
Specify a style for each tick:
TicksStyle (4)
By default, the ticks and tick labels use the same styles as the axis:
Specify an overall ticks style, including the tick labels:
Specify ticks style for each of the axes:
Use a different style for the tick labels and tick marks:
Applications (1)
Use the image histograms to estimate a suitable threshold:
Select threshold value using visual inspection of histograms:
Binarize image using selected threshold:
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:
Blend with black before computing the histogram:
Blend with white:
Drop the alpha channel:
Possible Issues (1)
Histograms with varying bin widths cannot be displayed using the "Stacked" appearance:
Use a different appearance:
Interactive Examples (1)
Interactive histogram of an RGB image:
Neat Examples (1)
Histogram of an image that is made progressively darker:
Tech Notes
History
Introduced in 2008 (7.0) | Updated in 2012 (9.0) ▪ 2014 (10.0)
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
BibTeX
@misc{reference.wolfram_2025_imagehistogram, author="Wolfram Research", title="{ImageHistogram}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/ImageHistogram.html}", note=[Accessed: 17-November-2025]}
BibLaTeX
@online{reference.wolfram_2025_imagehistogram, organization={Wolfram Research}, title={ImageHistogram}, year={2014}, url={https://reference.wolfram.com/language/ref/ImageHistogram.html}, note=[Accessed: 17-November-2025]}