Sub topic 3
Reading the histogram before you adjust
This chapter assumes you can open a file in Photoshop, find the Layers and Properties panels, and create an adjustment layer. It also assumes you know that an 8-bit RGB pixel stores three channel values from 0 (none of that color) to 255 (full). Levels and Curves, which come next, both work from what the histogram shows, so reading it comes first.
What a histogram shows
A histogram is a bar chart of how many pixels sit at each brightness value. The horizontal axis runs from 0 (pure black) on the left to 255 (pure white) on the right. The height of each bar is the count of pixels with that value. The vertical axis has no units you need to read. Photoshop scales the chart so the tallest bar fits the panel.
The histogram tells you about the distribution of tones. It says nothing about where in the picture those tones are. A dark band on the left could be a black suit, a shadow, or a night sky.
Divide the horizontal axis into three rough zones:
| Zone | Approximate values | What lives there |
|---|---|---|
| Shadows | 0 to 85 | Dark areas, deep shade, black objects |
| Midtones | 86 to 170 | Most of the visible detail in a typical photo |
| Highlights | 171 to 255 | Bright skies, white clothing, reflections |
The boundaries are a convenience, not a Photoshop setting.
Where to find it
Open Window > Histogram to show the Histogram panel. In the panel menu, choose Expanded View to see the channel and source options. Two settings matter for adjustment work:
- Channel. Luminosity shows overall brightness. RGB overlays the three color channels' combined counts. Red, Green, and Blue show one channel each. Colors draws all three channels in color.
- Source. Entire Image includes every visible layer. Selected Layer shows only the active layer. Adjustment Composite shows the result with the selected adjustment layer applied.
The Properties panel for Levels and Curves also draws a histogram behind the controls. For an adjustment layer, that background histogram shows the pixels the adjustment receives from the layers below it.
Photoshop may show a warning triangle on the histogram. It means the panel is using a cached estimate for speed. Click the triangle or the refresh button to redraw it from the actual pixels.
Reading the shape
Look at three things: where the data starts and ends, where it piles up, and whether it has gaps.
Range
If the data stops short of the left edge, nothing in the image is truly black. If it stops short of the right edge, nothing is truly white. This is the usual signature of a flat, low-contrast picture, such as a photo taken through haze or glass. Levels fixes this directly by moving the black and white points inward to meet the data.
Weight
If most of the mass sits on the left, the image is dark or low-key. If it sits on the right, the image is bright or high-key. A mass in the middle with empty ends is a flat, mid-gray image.
None of these shapes is wrong by itself. A photo of a snowy field should lean right. A night street should lean left. The histogram describes the image. Your intent decides whether it needs correcting.
Gaps and combs
A histogram with regular empty stripes, like the teeth of a comb, means the tonal values have been stretched. This happens when you push a low-contrast 8-bit image hard. Each missing value is a tone the file no longer contains, and it shows up as banding in smooth gradients such as skies. Gaps are a sign to adjust less, or to work in 16-bit mode (Image > Mode > 16 Bits/Channel) before making large changes.
Clipping
Clipping means pixels have hit the limit of the scale. A pixel at 0 in a channel has lost all information in that channel. A pixel at 255 has lost it at the bright end. Many pixels may share these values, and no adjustment can separate them again.
On a histogram, clipping appears as a tall spike pressed against the left or right edge.
- A spike at the left edge is shadow clipping. Dark detail has become solid black.
- A spike at the right edge is highlight clipping. Bright detail has become solid white.
Not every spike is a defect. A product photo on a pure white background should have a big spike at 255. A silhouette should have one at 0. The question is whether the clipped pixels contain detail you want, such as cloud texture or the folds of a shirt.
Checking which pixels are clipped
The histogram tells you that clipping exists. It does not show where. To find out, use the Levels adjustment's threshold preview. Hold Alt (Windows) or Option (macOS) while dragging the black or white input slider. The image turns white or black, and pixels that are beginning to clip appear as colored or dark spots. The next chapter covers this technique in detail. For now, note that the histogram and this preview answer different questions: how much and where.
Per-channel clipping
An image can look fine in Luminosity yet clip in a single channel. A saturated red flower can reach 255 in the red channel while green and blue stay lower. The flower then loses red texture and turns into a flat patch of color. Switch the Channel menu to Red, Green, or Blue to check each one. If a single channel piles up at an edge, saturated colors may be losing detail even though overall brightness looks fine.
Worked example: diagnosing three images
The pattern below is the habit to build. Look at the histogram, name the problem in words, then pick the tool.
| What the histogram shows | Diagnosis | Likely first move |
|---|---|---|
| Data from about 40 to 210, nothing at the edges | Flat, low contrast | Levels: move black and white points inward |
| Mass on the left, a small tail on the right | Underexposed | Levels midtone slider or Curves lift |
| Tall spike at 255, no data just below it | Blown highlights | Retake, or recover detail from another exposure; adjustment cannot restore lost pixels |
| Red channel piled at the right edge, others normal | Red channel clipping or a warm cast | Reduce saturation or correct the channel |
The third row matters. Once pixels are clipped, darkening them only turns white into gray. The gray has no texture, because every clipped pixel had the same value before you touched it.
A scripted histogram
You can compute the same data outside Photoshop. This script counts brightness values in a grayscale image and reports the fraction of pixels at each end. It needs the Pillow library (pip install pillow).
from PIL import Image
def histogram_report(path, edge=2):
"""Print range and clipping figures for a grayscale version of an image."""
img = Image.open(path).convert("L") # "L" = 8-bit luminance
counts = img.histogram() # list of 256 counts, index = value
total = sum(counts)
nonzero = [v for v, c in enumerate(counts) if c > 0]
low, high = nonzero[0], nonzero[-1]
shadow_clip = sum(counts[: edge + 1]) / total
highlight_clip = sum(counts[255 - edge :]) / total
missing = sum(1 for v in range(low, high + 1) if counts[v] == 0)
print(f"Darkest value: {low}")
print(f"Brightest value: {high}")
print(f"Pixels within {edge} of black: {shadow_clip:.1%}")
print(f"Pixels within {edge} of white: {highlight_clip:.1%}")
print(f"Empty values inside the range: {missing}")
if __name__ == "__main__":
histogram_report("photo.jpg")Reading the output follows the same rules as the panel. A darkest value of 40 and a brightest of 210 means a flat image. A large share of pixels near 255 means highlight clipping. A high count of empty values inside the range is the comb pattern.
Common errors
- Reading the histogram as a target. There is no ideal shape. Do not stretch a deliberately dark image to fill the whole range just to make the chart look full.
- Trusting a cached histogram. If the warning triangle is showing, the numbers are approximate. Refresh before judging clipping.
- Checking only Luminosity. Single-channel clipping hides there. Look at the individual channels for saturated subjects.
- Reading the wrong source. With Source set to Entire Image, the panel includes the adjustments you already made. Use Selected Layer when you want the original data, and Adjustment Composite to judge the result of the active adjustment.
- Judging a JPEG's headroom. A JPEG has already been rendered to 8 bits and its highlights may be permanently clipped. A raw file opened through Camera Raw may still hold recoverable data. Check before you assume detail is lost.
- Ignoring the gaps. Comb patterns appear after the damage is done. Check the histogram after each large move, not only at the start.
When to look
Check the histogram at three points: before you adjust, to decide what the image needs. After each adjustment, to confirm you have not clipped or combed the data. And at the end, to compare against the start. The panel updates live, so you can watch it respond as you drag a slider in the next chapters.
Exercise
An image's histogram shows data from about 30 to 225, no spikes at either edge, and no gaps. The Red channel alone shows a tall spike at 255. What does each observation tell you, and which check would you do next?
Show answer
The Luminosity range of 30 to 225 means the image is slightly flat, so Levels could move the black and white points inward to add contrast. The red spike at 255 means the red channel is clipping, probably in saturated red areas, so those areas may have lost texture even though overall brightness looks fine. Next, find where the clipping occurs (for example with the Levels threshold preview on the Red channel) and decide whether the affected area holds detail you want. If it does, avoid pushing saturation or brightness further there.
Exercise
You stretch a low-contrast 8-bit photo with a strong adjustment, and the histogram now shows evenly spaced empty stripes. What happened, what visible problem can it cause, and what two things can you do?
Show answer
The tonal values were spread apart, so some of the 256 values now have no pixels. This is the comb pattern. It can cause banding in smooth gradients such as skies. You can apply a smaller adjustment, or convert the image to 16-bit (Image > Mode > 16 Bits/Channel) before making large changes so there are more values available.