Compute and draw a color distribution histogram for the input video.
The computed histogram is a representation of distribution of color components in an image.
The filter accepts the following options:
- mode
-
Set histogram mode.
It accepts the following values:
- levels
-
standard histogram that display color components distribution in an image. Displays color graph for each color component. Shows distribution of the Y, U, V, A or R, G, B components, depending on input format, in current frame. Bellow each graph is color component scale meter.
- color
-
chroma values in vectorscope, if brighter more such chroma values are distributed in an image. Displays chroma values (U/V color placement) in two dimensional graph (which is called a vectorscope). It can be used to read of the hue and saturation of the current frame. At a same time it is a histogram. The whiter a pixel in the vectorscope, the more pixels of the input frame correspond to that pixel (that is the more pixels have this chroma value). The V component is displayed on the horizontal (X) axis, with the leftmost side being V = 0 and the rightmost side being V = 255. The U component is displayed on the vertical (Y) axis, with the top representing U = 0 and the bottom representing U = 255.
The position of a white pixel in the graph corresponds to the chroma value of a pixel of the input clip. So the graph can be used to read of the hue (color flavor) and the saturation (the dominance of the hue in the color). As the hue of a color changes, it moves around the square. At the center of the square, the saturation is zero, which means that the corresponding pixel has no color. If you increase the amount of a specific color, while leaving the other colors unchanged, the saturation increases, and you move towards the edge of the square.
- color2
-
chroma values in vectorscope, similar as
color
but actual chroma values are displayed. - waveform
-
per row/column color component graph. In row mode graph in the left side represents color component value 0 and right side represents value = 255. In column mode top side represents color component value = 0 and bottom side represents value = 255.
Default value is
levels
. - level_height
-
Set height of level in
levels
. Default value is200
. Allowed range is [50, 2048]. - scale_height
-
Set height of color scale in
levels
. Default value is12
. Allowed range is [0, 40]. - step
-
Set step for
waveform
mode. Smaller values are useful to find out how much of same luminance values across input rows/columns are distributed. Default value is10
. Allowed range is [1, 255]. - waveform_mode
-
Set mode for
waveform
. Can be eitherrow
, orcolumn
. Default isrow
. - waveform_mirror
-
Set mirroring mode for
waveform
.0
means unmirrored,1
means mirrored. In mirrored mode, higher values will be represented on the left side forrow
mode and at the top forcolumn
mode. Default is0
(unmirrored). - display_mode
-
Set display mode for
waveform
andlevels
. It accepts the following values:- parade
-
Display separate graph for the color components side by side in
row
waveform mode or one below other incolumn
waveform mode forwaveform
histogram mode. Forlevels
histogram mode per color component graphs are placed one bellow other.This display mode in
waveform
histogram mode makes it easy to spot color casts in the highlights and shadows of an image, by comparing the contours of the top and the bottom of each waveform. Since whites, grays, and blacks are characterized by exactly equal amounts of red, green, and blue, neutral areas of the picture should display three waveforms of roughly equal width/height. If not, the correction is easy to make by making adjustments to level the three waveforms. - overlay
-
Presents information that’s identical to that in the
parade
, except that the graphs representing color components are superimposed directly over one another.This display mode in
waveform
histogram mode can make it easier to spot the relative differences or similarities in overlapping areas of the color components that are supposed to be identical, such as neutral whites, grays, or blacks.
Default is
parade
. - levels_mode
-
Set mode for
levels
. Can be eitherlinear
, orlogarithmic
. Default islinear
.
Examples
-
Calculate and draw histogram:
ffplay -i input -vf histogram