Sub topic 10
How a Gradient Map maps brightness to colour
This chapter assumes you can create adjustment layers and layer masks, and that you can read a histogram. You should also know that a pixel's brightness (luminosity) is separate from its hue. If any of these are unfamiliar, review the earlier chapters on tonal range and adjustment layers first.
What a Gradient Map does
A Gradient Map is an adjustment layer that replaces the colours in your image with colours taken from a gradient. It doesn't use the original hue or saturation of any pixel. It measures only how bright each pixel is, then looks up a colour at the matching position along the gradient.
The gradient bar is a lookup table with the following layout:
- The left end of the gradient is used for the darkest pixels (shadows).
- The right end is used for the brightest pixels (highlights).
- Everything in between is used for the midtones, in order.
The result is that every pixel with the same brightness gets the same colour. A red shirt and a green door that happen to be equally bright become the identical colour after a gradient map at 100% opacity.
Creating a Gradient Map layer
Create the layer non-destructively so you can edit or delete it later.
- Open your photo in Photoshop.
- In the Layers panel, click the Create new fill or adjustment layer button (the half-filled circle icon).
- Choose Gradient Map.
- Open the Properties panel if it isn't already visible (Window > Properties).
The new layer appears above your image with a layer mask attached. Photoshop applies the gradient map using the gradient that is currently active in the Properties panel. By default this is a map from your foreground colour to your background colour.
A common surprise is that the image suddenly looks like a black-and-white or two-colour version of itself. That is the expected behaviour at 100% opacity with the Normal blend mode. The next chapters cover how to blend the effect back into the photo.
Where the default colours come from
When you add the layer, Photoshop builds the default gradient from the current foreground and background colours. Most people have black and white set, so the first result looks like a plain greyscale conversion. If your swatches are set to other colours, you will see those colours instead. You can change the gradient at any time by clicking the gradient bar in the Properties panel.
How brightness is calculated
Photoshop works out a single brightness value for each pixel, from 0 (black) to 255 (white) in an 8-bit file. The value is a weighted combination of the red, green and blue channels, not a simple average. Green contributes the most and blue the least, because human vision is most sensitive to green.
This has a practical effect. Two pixels with the same average of R, G and B can map to different positions on the gradient. For example, a saturated pure blue pixel is treated as quite dark, while a pure green pixel of the same channel value is treated as fairly bright.
| Pixel colour (R, G, B) | Approximate brightness | Gradient position |
|---|---|---|
| (0, 0, 255) pure blue | Dark | Left side |
| (255, 0, 0) pure red | Mid-dark | Left of centre |
| (0, 255, 0) pure green | Bright | Right of centre |
| (255, 255, 255) white | Maximum | Right end |
The table is approximate. The exact weights depend on the colour setup of your document, but the ordering of blue, red and green holds in practice.
Reading the gradient as a tonal map
It helps to think of the gradient bar as a second histogram axis. The histogram shows how many pixels exist at each brightness. The gradient bar shows what colour each brightness becomes. Putting the two side by side tells you where your colour decisions will land.
Suppose a portrait has most of its pixels between 60 and 200. Colour stops placed at the extreme ends of the bar (positions 0 and 255) will affect only a few pixels. The visible result would be weak, because the middle of your gradient is a blend between those two end colours. To grade where the pixels actually are, move your stops toward the occupied range.
A worked example: a warm and cool grade
This example builds a simple two-colour map. It makes shadows cool teal and highlights warm cream. The steps use the Gradient Editor, which later chapters cover in detail, so follow the values as written.
- Add a Gradient Map adjustment layer.
- In the Properties panel, click the gradient bar to open the Gradient Editor.
- Click the left colour stop beneath the bar. Click the Color swatch and set it to a dark teal, for example hex
0B2A33. - Click the right colour stop. Set its colour to a warm cream, for example hex
FFF1D6. - Click OK.
- At the top of the Layers panel, set the blend mode of the Gradient Map layer to Soft Light.
- Reduce the layer opacity to about 40%.
Your photo now has teal in the darks and cream in the lights, but it keeps its original colours underneath. Soft Light blends the map with the image beneath rather than replacing it. Without that step, you would see only the two-colour version of the photo.
Try toggling the layer's visibility (the eye icon) a few times. Comparing the before and after shows what the map contributes.
Gradient Map options: Dither and Reverse
The Properties panel has two checkboxes under the gradient bar.
- Dither adds a small amount of noise to the gradient result. This reduces banding, which shows up as visible steps in smooth areas like skies. Leave it on for most photographic work.
- Reverse flips the gradient left to right. Dark pixels then take the colour that was on the right, and bright pixels take the colour from the left. This is a quick way to invert the tonal relationship without rebuilding the gradient.
Reverse is useful for creating a negative-style effect or for testing whether your colours work better the other way round.
Edge cases and common problems
The image looks flat or posterised
A gradient with few colour stops, or with stops very close in colour, compresses contrast. Dark pixels and bright pixels end up with similar colours. You then see a loss of detail. Make sure your end colours differ clearly in brightness, not just in hue.
Highlights or shadows change brightness unexpectedly
The map replaces the pixel's colour, and the brightness of the new colour becomes the new brightness of the pixel. If your left stop is lighter than your right stop, the image looks inverted in tone. If the stops are close in brightness, contrast collapses. Always check the stop colours' own brightness, not just their hue.
Skin looks wrong
Because the map assigns one colour per brightness level, skin that spans a range of brightness can pick up bands of unrelated hues. At full strength this looks unnatural. Lower the opacity or use a blend mode, and apply restraint to midtone colours. A later chapter covers masks and skin protection.
Colour mode matters
Gradient Map works in RGB, CMYK and Lab, but it needs a colour image mode. On an indexed-colour file, the command is unavailable. Convert to RGB first (Image > Mode > RGB Color).
Layer order affects the result
The map reads the pixels beneath it in the layer stack. A Curves layer placed below the map changes the brightness values the map sees. A Curves layer above the map adjusts the already-coloured result. You will use this in the combined workflow chapter.
Summary of the working model
- A Gradient Map converts each pixel to a single brightness value.
- It then replaces the pixel with the gradient colour at that brightness position.
- Left of the bar is dark, right of the bar is light.
- At 100% Normal, the original hue and saturation are discarded.
- Opacity and blend modes bring the original colour back, and they are the main control for subtle grading.
Exercise
You add a Gradient Map to a photo of a red car beside a green hedge. At 100% opacity in Normal mode, the car and the hedge turn out almost the same colour. Why does this happen, and how could you keep their original hues while still adding a teal-to-orange tone?
Show answer
The Gradient Map uses only each pixel's brightness, not its hue. The red car and green hedge have similar brightness, so they land at nearly the same position on the gradient and get nearly the same colour. To keep the original hues, set the Gradient Map layer's blend mode to Soft Light (or Color or Overlay) and lower its opacity. The map then tints the image underneath instead of replacing its colours.
Exercise
A photo's histogram shows almost all pixels between 100 and 180. You build a gradient with a dark blue stop at position 0 and an orange stop at position 100, with nothing between 0 and 100 changing. The grade looks weak. What should you change?
Show answer
Most pixels sit in the middle of the brightness range, so they map to the part of the gradient that is mostly one blended colour, or in this case mostly orange. Move the stops toward the occupied range, for example blue near 100 and orange near 180, or add stops in that region, so the colour changes happen where the pixels are. You can also stretch the tonal range first with a Curves or Levels layer below the map.