Exposure and Contrast 3 - Curves

Exposure and Contrast adjustments part 3: Curves

Complex and powerful?


Ask a random person what comes to mind when hearing the word curves and expect a variety of answers. A mathematician may just see some lines, either curved or, “they can be straight as well”. Sports lovers will think of the top- or backspin that a ball can get when thrown or shot with a certain effect. Many will associate curves with the female figure. And for retouchers, curves may either refer to something so complex that it’s best to be avoided, or so powerful that any image defect deserves at least one curves adjustment.


So can we say that curves, in a Photoshop context, are both complex and powerful?


Powerful? For sure, as I will show in this article.


Complex? Not really. A curves adjustment is, well, touchy. Anything more than a small move has a strong effect. If you’re a newcomer, this may be intimidating. But in all fairness, that doesn’t make it complex. The mechanics of the curves dialog are easy to explain, and, once you understand what happens, make perfect sense. It just takes practice before you effortlessly apply a curves adjustment. Well then, let me help you by explaining the basics.


Curves: the basics

Curves in the sky

Start Photoshop and open any image. Menu: Image – Adjustments – Curves will give you a Curves popup, but it’s better to work on an adjustment layer. So Menu: Layer – New Adjustment Layer – Curves. Figure 1 is the original image that we’ll be working with, and figure 2 the popup that is shown.

Figure 1. Original image

Figure 2. Default Curves popup

So what do we see here? Curves' central control is a straight line that goes from bottom left to top right, superimposed against a histogram of the image. This diagonal line is a mapping that defines the adjustment that we are making. Think of the horizontal axis as “existing values” and the vertical axis as “adjusted values”. When opening the dialog, the line makes an exact 45° angle, so every point has equal distance to the horizontal and to the vertical axis. In other words, every “existing value” is mapped to the same “adjusted value”: hence, no change in the image.


The endpoints of the line are displayed as small squares. These are two control points that you get from Photoshop for free. The default presentation for RGB- and LAB-coded images is: bottom left is black, top right is white. The default for CMYK and Grayscale images is the other way round. For now, we assume an RGB image and we’ll stick to the default. So the meaning of the two endpoints is: black, bottom left, is mapped to black and white, top right, is mapped to white. More about them later.


Now move the mouse over the line, and notice that the pointer changes to a crosshair symbol. This is the indication that you can start adjusting. Click and hold the mouse and move it either upwards or downwards. Release the mouse button. The line has changed: it now somewhat resembles an arc of a circle; plus, there is a new control point right where you finished your move. The endpoints (black and white) haven’t moved though. The new control point is on both sides connected with the endpoints, not by two straight lines but by one smooth curve. See figure 3.

Figure 3. Curves adjustment and resulting image

So what’s the effect on the image? If you dragged the diagonal line upwards (as in figure 3), you raised the pixel values of your image. In the RGB model, this means that you made your image lighter. Similarly, if you made a downward move, you just darkened your image. The Input and Output fields right below the graph contain the numeric representation of your move. In figure 3, the values are 154 and 183, meaning that a pixel value of 154 in the original image has now changed to 183. The fixed endpoints tell me that original values of 0 and 255 haven’t changed at all. Anything in-between is dictated by the curve.


Further possibilities


The previous paragraph covers the essence of the Curves adjustment. The rest is really just more of the same. Let me go through some of the things that can be done next:


1. If your adjustment is too strong, or not strong enough, you can fine-tune it by dragging the new control point up or down (or even left or right). Alternatively, you can update the Input and Output fields to your liking. Photoshop will keep point and numbers matched.

2. You can delete a control point by cliking on it (it turns black to indicate that it gets the focus) and then hitting the Delete button. The two endpoints cannot be removed.

3. The most important functionality of the Curves dialog: you can add more control points. As many as you like! See figure 4. Well, in reality the maximum is 16, but in normal usage you will never reach that. This possibility to set multiple control points is the most important feature that distinguishes Curves from Levels and all other exposure and contrast adjustments. It makes Curves extremely powerful and versatile.

Figure 4. Extreme curving.

4. Similar to Levels, a Curves adjustment can be applied per channel. Right above the graph, there is a drop-down field which is by default set to “RGB”. Click it and choose one of the individual components. You are now able to just manipulate that one color. Be aware that any adjustment on the RGB curve (usually called the “master curve”) works on all three channels simultaneously.


5. The two endpoints can be freely moved left, right, up and down – within the borders of the graph of course. As an example, move the top right endpoint leftwards, say to 230. (Input 230, Output 255.) Photoshop will automatically connect the new endpoint with the top right point of the graph (figure 5). In numeric terms, this means: map all pixel values of 230 and higher to 255. For your image, it means that you adjusted your white point.
Next, move the new endpoint 25 points downwards: Input 230, Output 230. The curve right of the endpoint makes the same vertical shift (figure 6). All pixel values of 230 and higher are now mapped to 230.

Figure 5. Adjusting the white point

Figure 6. Further adjustment

6. Instead of a smooth curve, it’s possible to create a more angular or even freely painted “curve” by switching to the draw mode. Click the pencil symbol left of the graph. Starting at any point, you can now redraw the curve. By shift-clicking it is possible to create a curve like in figure 7. By releasing the mouse and continuing at a different height the result may even be like in figure 8. This is a rather exotic way of working which I never use. Artists seeking abstract representations of a photograph may adore it, but for serious image processing it’s not of much use. Figure 9 shows the result of appying the curve of figure 8 to our example image. Note the extreme artifacting.

Figure 7. Angular curve

Figure 8. Very weird curve

Figure 9. Result after applying the curve of figure 8

Comparing Curves with Levels


Assuming you are experienced with Levels and not with Curves, the following mapping of the two can give you a starting point of how to work with Curves. See figure 10 for the five important controls of the Levels dialog, numbered 1 to 5.

Figure 10. The five central controls of Levels

Figure 11. Simple contrast curve and resulting image

#1, the black slider right below the histogram. Moving it rightwards is equivalent to moving Curves’ bottom left control rightwards. (Take care not to move it upwards at the same time. The Output field is supposed to be 0.)

#2, the gray slider. Moving it right is similar (not equal!) to creating a new control point somewhere in the middle of the Curves graph and moving it downwards. Moving it left is similar to creating such a control point and moving it upwards.

#3, the white slider right below the histogram. Moving it leftwards is equivalent to moving Curves’ top right control leftwards.

#4, the black slider below the gradient line. Moving it rightwards is equivalent to moving Curves’ bottom left control straight up.

#5, the white slider below the gradient line. Moving it leftwards is equivalent to moving Curves’ top right control straight down.


The limitation of Levels becomes clear from this short overview. Here is a simple Curves move that cannot be duplicated by Levels. Pick a control point about 25% from the left and move it downwards. Pick another control point about 25% from the right and move it upwards. The simple effect of this is that darks are made darker and lights lighter, while white and black points are retained. This is called an S-curve, and it is an effective way of increasing contrast of an image. See figure 11 for what that looks like, superimposed over the resulting image. Such a move is obviously not possible in Levels with its single middle control point.


A practical example


I will give you a typical Curves correction. The image of figure 1 suffers from a common defect in scenes with strong sunlight: the shadows have a blue cast. Have a look at the detail of figure 12 below.

Figure 12. Image fragment with two sample points.

The two sampled points are taken from the same floor, so should have approximately the same color, right? The measured pixel values tell a completely different story. The pixel in the sun has RGB values 202, 187 and 178 resp. and the one in the shade 35, 46 and 64. One is a light beige, the other a dark greenish blue. How come? Shadow areas under a bright blue sky have a blue tinge, we’ve seen that before. See my article "The case of the blue shadows" which has this effect as its main subject, and my second article about Channels where I show a correction using a Channel Mixer adjustment. 


Back to our example image. Should we correct the light sample point or the dark one? I vote for the dark one. The color of the floor looks like the beige that we measured in sample #1. So should the color of sample #2 be equal to that of #1? Well, I doubt it. A bit of blueness can remain in or the result will look unnatural. Let’s assume, for the sake of this example, that you want #2 to be exactly neutral: equal R, G and B values. In the original, they are 35, 46 and 64 respectively. Let’s see how we can bring these three numbers together - say, adjust each to 50.


Open a Curves adjustment layer. Do not touch the RGB curve: for now, we are not interested in luminosity or contrast, only in color. So, switch to the Red curve. Let’s update the current value of 36 to 50. Pick the curve at the lower 20% and move it upwards (no need to be precise). Switch to the Input and Output fields and update their values to what we want them to be: 35 and 50 resp. Now the Red curve is way above the default: the full image has become considerably more red. This is not what we want. From about the center of the graph, the curve needs to converge towards the 45° line, to retain lighter pixels. So, add another control point about in the middle of the curve and pull it downwards until the top half of the curve closely touches the diagonal. See the left curve of figure 13 for what it should look like.

Figure 13. Red, green and blue curves to correct blue shadows.

Repeat the procedure for the Green and Blue curves: one control point that brings the sampled shadow point to 50, another further up to bring the top half of the curve close to the diagonal. Figure 13 shows the three curves as I created them, and figure 14 shows the resulting image, compared with the original. Note how not only the shadows on the floor have a friendlier look, but the bronze of the statue has gotten a more natural color as well: not the hard blue of the original but a more brown-greenish tint.

Figure 14. Original image (left) compared with corrected image (right).

Curves for contrast


In one of the previous paragraphs, I showed a common way of increasing contrast in a photograph: the so-called S-curve (see figure 11). Lift the curve in the right half, and push it down in the left half. Note that, just like what happens with the Contrast slider in the Brightness/Contrast adjustment, color is affected when doing this, even though we don’t touch the R, G and B curves. This is an inevitable side-effect of how the master (RGB) curve works: all channels are adjusted equally. Starting with, say, a low Red and Green and a high Blue, an S-curve will make the Red and Green even lower and the Blue even higher. Hence: a stronger, more saturated color. Whether this side-effect is beneficial or not depends on the image. A simple counter-move is to change the layer’s blend mode to Luminosity, but this tends to make the image somewhat dull.


Here is an important thought. Does an S-curve really increase contrast of an image? It may certainly look like that, but there is a catch in the deal. Our example image clearly shows what happens. The curve was lifted at about 75% lightness. The white point was untouched though. It follows that in the very light image areas, less room for contrast is left. This is very clear in the sunlit parts of the floor around the statue, see figure 15 (left: original; right: after applying S-curve).

Figure 15. Highlight area before (left) and after (right) S-curve application

More contrast? No way. After applying the S-curve, this whole area has become paler, squeezed into a smaller range of lightness values. The move that we made increased contrast between light and dark areas (especially in the midtones) but the price is a decrease in contrast in the very darks and the very lights. This effect corresponds to the shape of the curve. Contrast is strengthened where the curve is steep (around the midtones). It is weakened where the curve is flat (in the shadows and hightlights). Keep that in mind whenever you draw a curve. For optimal effect, a curve should be steepened where important image areas reside, and flattened anywhere else.


Inverting the S-curve or not?


Looking carefully at our original image, it may become evident that an S-curve is not such a good idea at all. Due to the harsh sunlight, the contrast between lights and darks is already considerable. It seems like this image is better served by something like an inverted S-curve: an adjustment that lightens the shadows and darkens the highlights. Well, why not try that? Figure 16 shows the idea, and figure 17 is the result. So… what about it?

Figure 16. Inverted S-curve

Figure 17. Resulting image

I can tell you that an inverted S-curve, applied to a normal photograph, is rarely a good idea. Using the reasoning of the previous paragraph, it follows that contrast is enhanced in the highlights and in the shadows (that’s good), but this happens at the cost of a loss of contrast in the midtones. The question is whether the benefits outweigh such loss. Indeed, the action has softened the harsh contrasts of the original. But various image areas have severely suffered: the sea surface, the front of the statue base and the distant mountains. Each of these is a lot flatter than they were in the original. See figure 18  (left: original, middle: inverted S-curve applied) for evidence. I wouldn’t be content with this result, even if we consider this image area as less important.


For a photograph like this, with strong contrasts between light and dark areas, a better idea is to do the darkening and lightening in separate layers (each a Curves adjustment) and apply appropriate masks to each. See my Two Sides action which does exactly that. The difference can be striking for midtone areas. Figure 18 (right) is the result of this action for the chosen image fragment.

Figure 18. Left: original. Middle: processed with the curve of figure 16. Right: processed with "Two Sides" action.

Finalizing comments


I tried to remove some of the fear that some might have for Photoshop’s Curves, by explaining its basic mechanics and presenting some simple examples. Of course, a lot more can be said of the popup itself and all of its controls. Curves has eyedroppers for white, gray and black. It has a Preset drop-down with entries like “Darker”, “Medium Contrast”, “Negative” etc. It offers a way to store the current state of a curve as a new preset. It has an Auto button (what that does will be explained in a future article). It even has an action with a tooltip that reads “Calculate a more accurate histogram” (read my first article about Histograms to get an idea what that is supposed to do).


I haven’t covered any of these things (which could easily make up another article). The fact is, I don’t think you need that. Most of these controls are really just gimmicks, small tricks to reduce something that otherwise takes three clicks to a single-click action. I am sure, if you are interested enough in Curves to read this article up to here, you are able to find out by yourself what these extra controls do, and work out what’s useful in your particular workflow.


The only really important advice I can give you now is: practice, practice, practice! Make sure you apply curves as easily as you use a screwdriver to tighten a screw, or a knife to peel an apple. For all contrast- and color-related corrections, I think Curves is an undispensable tool.


Gerald Bakker, 11 October 2020




Related articles

Photoshop by the Numbers

Copyright © 2015-2020 Gerald Bakker. All Rights Reserved.