Sub topic 4
Levels: Black Point, White Point, and Midtones
Prerequisites and the Levels model
This chapter assumes you can navigate Photoshop, use the Layers panel, and understand that an RGB image stores brightness and color as channel values from 0 to 255.
A Levels adjustment remaps existing pixel values. It uses three main input controls:
- Black point: the input value that becomes pure black.
- White point: the input value that becomes pure white.
- Midtone slider: the gamma control that brightens or darkens values between the black and white points.
When you create a Levels adjustment layer, Photoshop stores these settings separately from the image pixels. You can reopen the Properties panel and change them later. Applying Levels directly through an image command changes the pixels and reduces your ability to revise the edit.
Read the histogram first
A histogram shows how many pixels have each brightness value. The left side represents shadows, the middle represents midtones, and the right side represents highlights.
Look for empty space between the histogram data and either endpoint:
- Empty space on the left can mean the image has no true black.
- Empty space on the right can mean the image has no true white.
- Data pressed against an endpoint can indicate clipping. Clipped pixels contain no recoverable detail in that channel.
The histogram is evidence, not a target. A low-key photograph may correctly contain mostly shadows. Do not force its data to fill the whole graph just to make the histogram look balanced.
Set black and white points
- Select the image layer, or select the layer that should receive the correction.
- Choose Layer > New Adjustment Layer > Levels, then select OK.
- In the Properties panel, inspect the histogram.
- Move the black input slider toward the beginning of the data. Stop when important shadow detail would begin to disappear.
- Move the white input slider toward the end of the data. Stop before important highlight detail clips.
The black and white sliders increase contrast because they compress the unused input range into the output range. They do not create detail that was never captured.
The output sliders at the bottom set the darkest and lightest values that the adjustment can produce. Raising the output black value creates a faded black. Lowering the output white value creates a softer highlight. These controls can help when a print or display process cannot reproduce the full tonal range.
Adjust midtone brightness
The middle input control changes brightness without moving the endpoints. In Photoshop, moving it left brightens midtones, while moving it right darkens them.
Use this control after setting the endpoints. For example, a backlit portrait might need a slight leftward move to brighten the subject. Check the face and other important areas rather than judging only the overall image.
The calculation can be modeled like this:
def levels(value, in_black=0, in_white=255, gamma=1.0,
out_black=0, out_white=255):
"""Map one 8-bit channel value through a Levels adjustment."""
t = (value - in_black) / (in_white - in_black)
t = min(max(t, 0.0), 1.0)
t = t ** (1.0 / gamma)
return round(out_black + t * (out_white - out_black))
print(levels(128, in_black=20, in_white=235, gamma=1.1))A gamma value above 1 brightens the middle range in this model. Photoshop presents the equivalent change through the slider position, so focus on the visible result rather than calculating the value manually.
Common errors
- Setting endpoints at the histogram edges without checking detail.
- Using Levels to fix a color cast that requires channel-specific work.
- Making a large midtone change and then compensating with excessive contrast.
- Editing the original pixel layer instead of creating an adjustment layer.
- Forgetting to compare the result with the adjustment layer temporarily disabled.
Exercise
An image has empty space before its histogram begins, but important shadow texture is already close to black. Should you move the black slider all the way to the histogram data?
Show answer
No. Move it only far enough to improve contrast without clipping the important shadow texture. The histogram alone does not determine the correct setting.