◩ Graphics & images

Histogram, levels and curves: reading and fixing a photo's tones

How to read a photo's histogram, spot blown highlights and blocked shadows, and use levels and curves to correct exposure and contrast in a measured way.

Judging an image by eye is influenced by many things: screen brightness, room lighting, habit. The histogram is an objective tool that shows how tones are distributed, and levels and curves are the tools that let you change that distribution precisely. Together they form the basis of any serious tonal correction.

What the histogram shows

The histogram is a bar chart. The horizontal axis holds the tonal values, from black on the left to white on the right (0–255 in an 8-bit image). The height of each bar shows how many pixels have that value.

There is no "right" histogram. A photo of snow is naturally shifted to the right, a night scene to the left. The histogram does not judge the image: it describes it. The useful information is:

  • where the distribution starts and ends, that is, whether the image uses the full tonal range;
  • whether there are pile-ups at the edges, a sign of clipped data;
  • where most of the pixels are concentrated.

Three problems the histogram reveals

Blown highlights

A spike pressed against the right edge means many pixels at the maximum value: in those areas there is no detail left, only white. A small amount can be acceptable (reflections, light bulbs), but a wide spike over a sky or a light-colored garment means lost information.

Blocked shadows

The same applies on the left: a pile-up at the edge indicates shadows with no detail. They are often more tolerable than blown highlights, because the eye accepts deep shadows as natural.

Low contrast

If the distribution occupies only the central part, leaving gaps on both sides, the image looks veiled, "milky." This is typical of photos taken through glass, in haze, or scans of faded prints.

Per-channel histograms

Many programs also show separate histograms for red, green and blue. They are useful because one channel can be clipped even when the luminosity histogram looks fine: an intense red sunset, for example, may have a saturated red channel and show flat patches with no detail.

The Levels tool

Levels offers three sliders under the histogram:

  1. black point: all values to the left of the slider become black;
  2. white point: all values to the right become white;
  3. middle slider (gamma): shifts the midtones, lightening or darkening without changing the two extremes.

To correct a low-contrast image, move the black and white sliders to the beginning and end of the distribution. Many programs let you hold a key while dragging to see in real time which pixels are being clipped: it is the safest way to stop at the right point.

Applying levels separately to the three channels also corrects a color cast: if one channel is shifted relative to the others, realigning its extremes neutralises the cast.

The Curves tool

Curves is the generalisation of levels. It shows a diagonal line linking input value (horizontal axis) and output value (vertical axis). Moving points on the line remaps tones arbitrarily.

Some classic shapes:

Curve shape Effect
Center point moved up lightens midtones
Center point moved down darkens midtones
Gentle "S" increases midtone contrast
Inverted "S" reduces contrast, softens
Left end raised faded shadows, "film" look
Right end lowered dull whites, no pure white

One rule to remember: where the curve is steeper, contrast increases; where it is flatter, contrast decreases. An S curve increases midtone contrast at the expense of shadows and highlights, which become more compressed. You cannot increase contrast everywhere: you move it around.

A practical workflow

In my work I follow a simple order:

  1. I look at the histogram and those of the individual channels.
  2. I set black and white with levels, without clipping important detail.
  3. I adjust midtones with the middle slider or a point on the curve.
  4. I add contrast with a gentle S curve, if needed.
  5. I apply corrections as adjustment layers, not directly to the pixels, so I can change them later.
  6. I work at 16 bits when corrections are strong, to avoid a "combed" histogram and banding.

Beware the limits

The histogram shown on a camera's display is calculated from the JPEG preview, not from the RAW data. That is why a histogram that looks blown in camera may still have headroom in the RAW file. It is cautious information, not exact.

Moreover, the histogram says nothing about where the pixels are. Two completely different images can have the same histogram. It should always be read together with the image, not instead of it.

In short

  • The histogram shows how many pixels have each tonal value, from black to white.
  • Pile-ups at the edges indicate blown highlights or blocked shadows; a narrow distribution indicates low contrast.
  • Levels sets black, white and midtones; per channel it corrects color casts.
  • Curves remaps tones freely: where the curve is steep, contrast increases.
  • Use adjustment layers and 16 bits for strong, reversible corrections.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. A computer science graduate, he combines rigorous technical analysis with attention to the people who use technology.

Read also