Sub topic 2
Curves: shaping contrast with control points
This chapter assumes you can create adjustment layers, use the Layers panel, and read RGB brightness values. It covers Curves, Hue/Saturation, and layer masks on adjustment layers.
Shaping contrast with Curves
A Curves adjustment layer maps each input brightness to a new output brightness. The horizontal axis holds the original value, and the vertical axis holds the result. Click the line to add a control point, then drag it. Pulling the shadow end down and the highlight end up creates an S-shaped curve, which increases contrast.
The code below models this mapping with straight segments. Photoshop draws a smooth spline, so real results differ slightly.
def curve(value, points):
pts = sorted(points)
for (x0, y0), (x1, y1) in zip(pts, pts[1:]):
if x0 <= value <= x1:
return y0 + (y1 - y0) * (value - x0) / (x1 - x0)
raise ValueError("value is outside the curve's input range")
s_curve = [(0, 0), (64, 48), (192, 208), (255, 255)]
print(round(curve(128, s_curve))) # prints 128, so the midtone stays put> Tip: Use the Channel menu in the Properties panel to edit Red, Green, or Blue curves separately when a color cast needs correcting.
Callout:
Hue/Saturation: global color changes
A Hue/Saturation adjustment layer shifts the Hue, Saturation, and Lightness of every color in the image. Drag the Saturation slider to make colors stronger or weaker. Hue rotates all colors around the color wheel. Lightness brightens or darkens them.
Hue/Saturation: targeting specific color ranges
Open the Master dropdown to limit the change to one range, such as Reds, Yellows, Greens, Cyans, Blues, or Magentas. Photoshop then changes only pixels in that range. The sliders along the bar at the bottom show which hues each range includes, so you can widen or narrow the selection.
Limiting an adjustment with its layer mask
Every adjustment layer has a mask thumbnail. Painting black on the mask hides the adjustment, and painting white reveals it. Use a soft brush at a low opacity to blend edges. Press Ctrl+I (Cmd+I on Mac) to invert the mask quickly.
Exercise:
Exercise
You want to deepen only the shadows of a Curves layer. Which control point do you move, and where does it go?
Show answer
Move the point near the shadow end, such as (64, 64), down to (64, 48). The midtone point at 128 stays fixed.