Raw Image Analyzer User's Guide

Table of Contents


Histogram display

There are several ways the distibution of pixel values can be presented. Common between these histograms is, that they are always based on non-demosaiced pixel values, representing the three "channels" of the sensor, and all pixels are involved in the calculation (as opposed to sampling), therefor the histograms are always accurate.

The basic raw histogram

The basic raw histogram will be shown if neither the Mapped nor the Fine checkbox are checked.

In basic mode the histogram represents the entire range of unmodified raw pixel values. The histogram consists of 512 columns; as the pixel value range is alway larger than 512, one column of the histogram represents a number of pixel values. For example if the numerical range of the pixel values is 0-3900, then each each column represents alternatingly seven or eight consecutive pixel values. If the value range is 4096 (12 bit depth), then each subrange is 8 levels wide; the first column represents the levels 0 to 7, the second one the values 8 to 15 and the 512th column represents the pixel values 4088 to 4095.

Note, that the numerical pixel value range is not always the same as the numerical range of the bit depth. Some cameras create raw data, which fully occupies the range of the bit depth, while the numerical pixel value range with some other cameras (for example Canon DSLRs) can be substantially smaller than the range given by the bit depth. In some cases the range depends on the ISO and/or on the channel. The actual range used in the histogram is declared in the camera's description, which is hard coded in Rawnalyze; it is equal to or slightly greater that the initial white point, and it is always the same for all three channels, even if the saturation levels of the channels are different.

The height of the histogram is 128 pixels; the height of a column represents the number of pixels with the value falling into the subrange of that column in proportion of all pixels of that color. If the sensor contains 8 million pixels, 2 million of those are capturing the red range. If there are 100,000 pixels in the value range 1000 to 1007, then the 126th pixel column of the histogram represents 5% of all red pixels, assumed the range of pixel values is 0-4095.

However, the height of the pixel column is not in direct proportion to the percentage of pixels it is representing, because that way small pixel amounts would not be visible - or the histogram would have to be several thousand pixels tall. Instead, the hight represents the logarythm of the percentage.

A two pixels tall column represents 0.01%; a column as tall as the first white marker from the bottom upwards represents 0.05%, the hight of the next marker is at 0.1%, etc. It is not easy to determine exactly how many pixels are in a column, but it is not important either.

The meaning of a single-pixel column is, that there is at least one pixel in that range, but less than 0.01%. Note, that this can be triggered even by a "hot" or "stuck" pixel.

The short white lines under the histogram mark the exposure value oriented distribution in the levels. If one imagines the right end as EV 0, then the first marker from the right side represents the 1/3 EV lower point, the second marker is at -2/3 EV, the third, somewhat larger marker is at -1 EV, etc. Obviously the range of the highest stop occupies half on the entire histogram.

The yellow dotted pixel column close to the left edge marks the black level (the minimum of the black correction values), the one close to the righ end marks the saturation level. The black level, if visible, is at the same location in all three histrograms; the location of the saturation marker may be different for the colors, depending on the sensor.

The left turquoise dotted pixel column (this does not have to be at the left side) marks the black point, the value is shown in the input field of the black point control group; the right turquoise pixel column represents the white point, the value is displayed in the input field of the white point control group. These two can be at the same location.

If an indicator pixel column is not visible, then it can be imagined at the left respectively right edge of the histogram.

The fine raw histogram

The basic raw histogram conveys an overview of the exposure. This is suitable in many cases; however, it is somewhat coarse, because each column represents a range of pixel values. The fine raw histogram shows the detailed distibution of pixel levels, as each column of the histogram represents a single pixel level. The fine raw histogram will be shown if the Fine checkbox is checked.

The histogram consists of 512 columns, each maximum 128 pixels tall. These 512 columns show a "crop" of the complete fine histogram, starting with the pixel level indicated in the black point field. As the black point value is changed, the histogram's range moves in the total pixel value range, i.e. it represents the crop starting with the new black point value.

The height of the a column represents the number of pixels with the respective value in proportion of all pixels of that color, relative to the total pixel value range, on the same logarythmic scale as in the basic raw histogram.

The white markers at the bottom of the histograms indicate the locations of 1/10th of the 512 wide range. In other words, the markers are in 51 pixels distances. The position of a marker added to the current black point yields the pixel value represented by the column over the marker. For example if the current black point value is 128, then the second marker indicates the position correspoding to the pixel value 230.

Gaps in the histogram indicate, that there is no pixel with the respective value. The gaps in the above example are due to the lossy compression of the image file.

The mapped histogram

If the Mapped checkbox is checked, then the histogram represents the pixel values after following adjustments:

This histogram too is based on non-demosaiced data, i.e. the red, green and blue histograms still represent the pixels with the corresponding color filters. Thus this this histogram reflects the image displayed in composite, channel or greyscale mode, except for the clipping indication.

The appearance of the mapped histogram differs from the basic raw histogram in following aspects:

A particular combination of setting worth of mentioning is, when the black point and white point are at their initial values, the lightness adjustment is null, the mapping method is "Linear" and the white balance is set. The mapped histogram with white balance applied appears like a white balanced raw histogram.


This is the initial state of the raw histogram of an image created by a Canon 40D.
The saturation level is 12740 at ISO 160, and the histogram range ends at 12800. The first dotted column contains both the black level and black point indicators, the second one contains both the white point and the saturation level indicators (the saturation levels happen to be the same for all three colors in this case).

The histogram shows, how well (or not) exposed the shot was. In this case only slightly more than one third of a stop could have been added to the exposure without causing clipping, even though the shot is strongly underexposed (the dynamic range exceeded the camera's capturing capacity)

This is the typical sign of clipping caused by specular spots or direct light; in this case the sun was the cuplrit, but it caused less than 0.1% of all pixels clipping

The saturation levels of the three colors are very different with this camera.
Over 10% of the pixels clipped

This is the effect of the lossy raw compression by some cameras, for example Nikon: groups of levels are simpy left out. The range of these group is increasing at higher pixel values. Therefor there are no gaps, only spikes at the dark end, but the ranges of "gaps" are becoming larger towards the bright end, so far, that there is no pixel in the entire subrange associated with some columns of the histogram, causing the gaps in the histogram

The effect of the lossy raw compression up-close, pixel level by pixel level

The mapping of the six hundred some different raw values to the 256 RGB values eliminates the gaps, but some strange spikes are still appearing

The application of white balance blends the levels more; these spikes are not perceivable on the resulting image when displaying or printing

The Stouffer wedge is a colorless transparent consisting of strips with transparency 1/3 stop apart. Despite looking boring as a photographic object, it is useful in the explanation of some subjects.

This is a crop of the image before white balancing. As the strips are colorless, they ought to appear grey; as such they are suitable for white balance picking

This is the raw histogram; the spikes/bumps represent the strips. Had they been captured as grey, i.e. red, green and blue with equal intensity, the spikes/bumps would line up nicely

The histogram of the mapped data without white balance too shows a shift between the intensities of the colors of strips

White balancing multiplied the red pixel values by 1.09 and the green ones by 0.6094, causing the three spikes from the strips lining up

As the result, the strips now appear grey

Linear mapping of the white balanced image shows the effect of white balancing on the raw data

Setting the black point to 500 and the white point to 2000 increases the contrast, while pushing the lower values in black and the higher values in white

the histogram shows how the contast is increased: a range of the raw values is mapped on the entire RGB range

With black point 1000 and white point 2500, only 1500 levels are mapped on the entire RGB range, which increases the contrast even more

the histogram shows, that less strips are mapped to the same RGB range, which in turn increases the spacing between them even more

Top Of Page Table of Contents

Modified: 2008-01-29