# bar chart

In this lesson we will talk about what a histogram is and what useful information for further work with an image can be extracted from it.
You can see the image histogram by selecting in the menu Window – Bar Graph (Window – Histogram).

At first glance, understandable enough. The same person understands, far from medicine, when he sees a cardiogram or encephalogram. But, unlike medical charts, everything is much simpler with a histogram. It serves as the main tool for an objective assessment of the technical parameters of the photograph, along with the palette Info

The histogram graphically shows the distribution of image pixels by brightness levels. The higher the histogram bar, the more pixels of a given brightness are present in the image. You can study the histogram directly in the palette, or by calling the command Levels (Levels). To do this, click CTRL + L.

The histogram can be divided into three areas: the leftmost is called the area of ​​shadows (Shadows), the rightmost is the area of ​​highlights (Highligts), the central part – by the middle tones (Midtones).

It is also customary to distinguish between quarter brightness gradations: lights, quarterton, halftones,three quarter tones. On the black density scale, respectively, 0, 25, 50, 75, 100%. In Photoshop, this gradation is used in the dialog box. Curves Curves).

Basic information about the image is obtained by selecting in the field Channel (Channel) values Glow (Luminosity). In this case, only the brightness component is displayed on the histogram. Also in this field, you can choose to display other channels (red, green, blue, etc., depending on what color space you are working on).

In line The average (Mean) indicates the weighted average brightness level of the image pixels, which is obtained by multiplying each brightness level by the number of pixels of this level, and then divided by the total number of brightness levels. The higher the weighted average, the higher the lightness of the image.

In line Deviation (Std Dev) indicates the statistical (root mean square) deviation of the levels of tones. The greater the deviation, the higher the contrast of the image.

In line Median (Median) given the value of the tone, dividing the histogram sample into two equal parts. This tone is the midpoint of this histogram. Half of the sample lies on one side of the median, half on the other. The proximity of the median value to the deviation value indicates a uniform balanced tone of the image.
In line Pixels (Pixel) shows the total number of pixels in the image.

In line Counter (Count) – the number of pixels of a given tone or tone range (at the point where the mouse cursor is over the histogram).

In line Percentile (Percentile) shows the percentage of pixels to the left of the cursor.

On line Level (Level) we will stop in more detail. It shows the level of lightness of the tone. The data from this line is used to place the control points on the curves, which allows you to make very fine and precise image correction (you will learn about this in one of the following lessons). Also from this line you can get data for a range of tones. To select it, click the left mouse button and drag the cursor on the desired part of the histogram. Do not release the mouse button.

The selected portion of the histogram will turn white, and in the line Level The start and end range values ​​are displayed.

Now we will look at how to determine certain types of defects in the form of a histogram.

1. Underexposed snapshot.

The area filled with pixels of a picture with insufficient exposure is shifted to the left. Pictures with this defect are amenable to correction, but it is possible to increase the noise in the shadows. The exception is strongly underexposed photographs, or photographs taken against the sun. Dark areas of such images become almost black, they lose their color information, so it is problematic to restore images with such a defect.

Pictures taken in the evening or at night, as well as pictures of initially dark objects with no bright areas, are not considered underexposed (provided that they adequately depict the corresponding range of tones).

2. Overexposed image.

The case is exactly the opposite. In this case, the histogram lacks information in the area of ​​shadows and quarter tones. In the light region, the histogram closely approaches the right edge, which indicates the clipping of the lightest areas.

Artificial stretching of the tone range to full leads to an increase in white areas, which upsets the balance of colors. In addition, in the overexposed areas color information is completely absent, i.e. they have pure white color.

Correcting overexposed images is one of the most difficult tasks in digital photography. Usually strongly overexposed images are advised to consider spoiled.

It is possible to restore colors in bright areas only when shooting in RAW format, and then only when overexposure is no more than 0.5-1.5 steps.
It is also necessary to distinguish underexposed photographs and scenes where the shadows are almost absent, for example, portraits in the style of high key, shooting light colors on a light background, winter landscapes.

3. Weak contrast.

The low contrast image histogram has no pronounced peaks, its area is limited by a smooth curve. Although, at first glance, the photo shows the full tonal range, the overall contrast is clearly insufficient, which reduces the expressiveness of the image.

4. Excessive contrast (posterization).

With excessive contrast, there is a loss of brightness and color information, which is reflected in the irregularity, the appearance of gaps and gaps in the histogram. Such pictures are difficult to correct.

5. Normal histogram.

Note the full tonal range and the presence of several sharp peaks. They testify to the good development of individual objects and a sufficient level of contrast. Of course, the nature of a normal histogram depends on the plot of the survey and the purpose of the publication. In most cases, it is desirable to have a full tone range and pronounced accented areas on it.

Author: Evgeny Kartashov