Color Correction in Adobe After Effects CS3
No skill is as essential for a compositor as the ability to take control of color authoritatively and conclusively, making foreground and background elements seem to inhabit the same world, ensuring that shots from a sequence are consistent with one another, and matching their overall look to the artistic direction of the project.
After all, the compositor is typically the last person to touch a shot before it goes into the edit. Inspired, artistic color work injects life, clarity, and drama into standard (or even substandard) 3D output; adequately shot (or even poorly shot) footage; and flat, monochromatic stills. Color draws the audience's attention where it belongs, never causing them to think about the compositing at all.
Good compositors are credited with possessing a "good eye," but color matching is a skill that you can practice and refine even if you have no feel for adjusting images—indeed, even if you consider yourself colorblind.
And despite the fact that new color tools appear each year to refine the ability to dial-in color, for color matching in After Effects, three color correction tools do most of the heavy lifting: Levels, Curves, and Hue/Saturation. In fact, because Levels and Curves overlap in their functionality, in many cases you're just choosing one or two of the three. These tools endure from the earliest days of Photoshop because they're stable, fast, and they get the job done every time. Just learn how to use them and keep practicing.
A skeptic might ask some questions:
- Why these old tools, with so many cool newer ones arriving?
- Why not use Brightness & Contrast to adjust, you know, brightness and contrast? Or Shadow and Highlight, if that's what needs adjustment?
- What do you mean, I can adjust Levels even if I'm colorblind?
This article holds the answers to these and many more questions. First, we'll look at optimizing a given image by using these tools, and then move into matching a foreground layer to the optimized background, balancing colors. The goal is to move you away from hacking, to building skills that eliminate some of the guesswork and enable artistry.
What constitutes an "optimized" clip? What makes a color-corrected image correct? Let's look at what's typically "wrong" with source-footage levels and the usual methods for correcting them, laying the groundwork for color matching. As an example, we'll balance brightness and contrast of a plate image, with no foreground layers to match.
Levels may be the most-used tool in After Effects, and yet it's rare to find detailed descriptions of how best to use it. It consists of five basic controls:
- Input Black
- Input White
- Output Black
- Output White
Each of these controls can be adjusted in five separate contexts (the four individual image channels R, G, B, and A—as well as all three color channels, RGB, at once). There are two different ways to adjust these controls: via their numerical sliders or by dragging their respective carat sliders on the histogram. The latter is the more typical method for experienced users.
Contrast: Input and Output Levels
Four of the five Levels controls—Input Black, Input White, Output Black and Output White—determine brightness and contrast (see Figure 1). Combined with the Gamma control, they offer more precision than is possible with the effect called Brightness & Contrast.
Figure 1 The Levels effect consists of a histogram and five basic controls per channel; the controls typically are adjusted using the triangles on the histogram, although the corresponding numerical/slider controls appear below.
Figure 2 shows a Ramp effect applied to a solid using the default settings, followed by the Levels effect. Move the black caret at the lower left of the histogram—the Input Black level—to the right, and values below its threshold (the numerical Input Black setting, which changes as you move the caret) are pushed to black. The further you move the caret, the more values are "crushed" to pure black.
Figure 2 Levels (top left) is applied to a layer containing a Ramp effect at the default settings, which creates a smooth gradient from black to white (top right). The bottom image will be used in this article as the basis for understanding what the color-correction tools do.
If you move the Input White carat at the right end of the histogram to the left, toward the Input Black caret, the effect is similar to Input Black's but inverted: More and more white values are "blown out" to pure white (see Figure 3).
Figure 3 Raising Input Black and lowering Input White has the effect of increasing contrast at either end of the scale. At an extreme adjustment like this, many pixels are pushed to full white or black (in an 8-bpc or 16-bpc project).
Either adjustment effectively increases contrast, but note that the midpoint of the gradient also changes if one control is adjusted further than the other. In Figure 3, Input Black has been adjusted more heavily than Input White, causing the horizon of the gradient to move closer to white and more of the image to turn black. You can re-create this adjustment with Brightness & Contrast (see Figure 4), but to do so you must adjust both contrast and brightness, with no direct control of the midpoint (gamma) of the image.
Figure 4 You can use Brightness & Contrast to match the look of the gradient in Figure 3, mostly because it has no gamma adjustment.
The Brightness & Contrast effect is like training wheels compared to Levels. It contains two sliders, one for each property. Raising the Contrast value above 0.0 causes the values above middle gray to move closer to white and those below the midpoint to move closer to black, in proportion. Lower the Contrast value and pixels turn gray. The Brightness control offsets the midpoint of any contrast adjustment, allowing a result like that in Figure 4.
So what's the problem? Almost any image needs black and white adjusted to different degrees, and Brightness & Contrast allows this adjustment only indirectly; this situation can make adjustment a game of cat-and-mouse, as illustrated in Figure 5. Add to that the fact that there's no histogram or individual channel control, and it becomes a lot like playing the piano with mittens on.
Figure 5 In this example, the source (left) was balanced for the sky, leaving foreground detail too dark to make out. Raising Brightness to bring detail out of the shadows makes the entire image washed out (center); raising Contrast to compensate completely blows out the sky (right). Madness.
Reset Levels (click Reset at the top of the Levels effect controls) and try the same experiment with Output Black and Output White, whose controls sit below the little gradient. Output Black specifies the darkest black that can appear in the image; adjust it upward and the minimum value is raised.
Similarly, lowering Input White is something like dimming the image, cutting off the maximum possible white value at the given threshold. Adjust both, and you effectively reduce contrast in the image; with the two settings close together, the gradient becomes a solid gray (see Figure 6).
Figure 6 Raising Output Black and lowering Output White reduces contrast in the dark and light areas of the image, respectively.
Evidently the Input and Output controls have the opposite effect on their respective black and white values when examined in this straightforward fashion. However, there are even situations where you would use them together.
As is the case throughout After Effects, the controls are operating in the order listed in the interface. In other words, raising the Input Black level first crushes the blacks, and then a higher Output Black level raises all of those pure black levels as one (see Figure 7). It doesn't restore the black detail in the original pixels. The blacks remain crushed; they all just become lighter.
If you're thinking, "So what?" at this point, just stay with me—we're breaking down the controls in order to build up an understanding.
Figure 7 Black and white levels crushed by adjusting the Input controls are not brought back by the Output controls, which instead simply limit the overall dynamic range of the image, raising the darkest possible black level and lowering the brightest possible white.
As you adjust the Input Black and Input White values, you may have noticed the third caret that maintains its place between them. This is the Gamma control, affecting midtones (the middle gray point in the gradient) at the highest proportion. Adjust it over the gradient and notice that you can push the grays in the image brighter (by moving it to the left) or darker (to the right) without changing the black and white levels at all.
Many images have healthy contrast, but a gamma boost gives them extra punch. Similarly, an image that looks a bit too "hot" may be adjusted instantly simply by lowering the gamma.
In most cases, the histogram won't offer much of a clue as to whether the gamma needs adjusting, or by how much. (See the later section "Problem Solving Using the Histogram" for more on this topic.) The image itself provides a better guide for how to adjust gamma.
So what's your guideline for how much you should adjust gamma, if at all? I first learned to adjust too far before dialing back, which is especially helpful. An even more powerful gamma-adjustment tool that scares most novice artists away is Curves (see Figure 8).
Figure 8 The image from Figure 2 is improved with a boost to gamma by using Curves (explained shortly). The indication that this is a good idea comes not from the histogram, which looks fine, but from the image itself, which lacks foreground detail.
By mixing these five controls together, have we covered everything there is to know about using Levels? No, because there are not, in fact, five basic controls in Levels (Input and Output White and Black plus Gamma)—instead, there are five times five (RGB, Red, Green, Blue, and Alpha).
Individual Channels for Color Matching
In baseball, most hitters are "hackers," unable to discern when to swing at a pitch in the fraction of a second it takes to approach the plate. A very few gifted hitters, even at the professional level, can actually discern a pitch as it approaches the plate at 90-plus miles per hour; Barry Bonds is the ultimate example, and I say that not only as a beleaguered Giants fan. If you color-correct images without looking at individual color channels, you're only hacking; but if you develop the habit of adjusting on individual color channels, you'll swing like Barry (with or without stimulants).
Many After Effects artists completely ignore that pull-down menu at the top of the Levels control that isolates red, green, blue, and alpha adjustments; even those who do use it once in a while may do so with trepidation. How can you predictably understand what will happen when you adjust the five basic Levels controls on an individual channel? The gradient again serves as an effective learning tool to ponder what exactly is happening.
Reset the Levels effect applied to the Ramp gradient. Pick Red, Green, or Blue in the Channel pull-down of Levels and adjust the Input and Output carets. Color is introduced into what was a purely grayscale image. With the Red channel selected, by moving Red Output Black inward, you tint the darker areas of the image red. If you adjust Input White inward, the midtones and highlights turn pink (light red). If you adjust Input Black or Output White inward, the tinting goes in the opposite direction—toward cyan—in the corresponding shadows and highlights. As you probably know, on the digital wheel of color, cyan is the opposite of red, just as magenta is the opposite of green, and yellow is the opposite of blue.
Gradients are one thing, but the best way to make sense of this information with a real image is to develop the habit of studying footage on individual color channels as you work. This is the key to effective color matching (detailed ahead).
Along the bottom of the Composition panel, all of the icons are monochrome by default save one: the Show Channel pull-down. It contains five selections: the three color channels as well as two alpha modes. Each one has a shortcut that, unfortunately, is not shown in the menu: Alt-1 through Alt-4 (Mac: Option-1 through Option-4) reveal each color channel in order. These shortcuts are toggles, so reselecting the active channel toggles RGB. A colored outline around the edge of the composition palette reminds you which channel is displayed.
Try adjusting a single channel of the gradient in Levels while displaying only that channel. You're back on familiar territory, adjusting brightness and contrast of a grayscale image. This is the way to work with individual channel adjustments, especially when you're just beginning, or if you're at all colorblind. As you work with actual images instead of gradients, the histogram can show you what's happening in your image.
The Levels Histogram
You might have noticed the odd appearance of the histogram applying Levels to a default Ramp. If you were to try this setup on your own, depending on the size of the layer to which you applied Ramp, you might see a histogram that's flat along the top with spikes protruding at regular intervals (see Figure 9).
Figure 9 Strange-looking histograms. A colored solid (top) shows three spikes—one each for the red, green, and blue values—and nothing else. With Ramp (bottom), the distribution is even, but the spikes at the top are the result of the ramp not being an exact multiple of 255 pixels, causing certain pixels to recur more often than others.
The histogram is exactly 256 pixels wide; it's effectively a bar chart made up of 256 single-pixel bars, each corresponding to one of the 256 possible levels of luminance in an 8-bpc image. (These levels are displayed below the histogram, above the Output controls.) In the case of a pure gradient, the histogram is flat because luminance is evenly distributed from black to white. If spikes occur in that case, it's because the image isn't exactly 255 pixels high (or some exact multiple of 256, minus one edge pixel because the Ramp controls default to the edges of the layer), making it slightly uneven at 8 bits per channel.
In any case, it's more useful to look at real-world examples, because the histogram is useful for mapping image data that isn't plainly evident on its own. Its basic function is to help you assess whether any color changes are liable to help or harm the image. There is in fact no one typical or ideal histogram—they can vary as much as the images themselves, as seen earlier in Figure 8.
Despite that fact, there's a simple rule for a basic contrast adjustment: Find the top and bottom end of the RGB histogram—the highest and lowest points where there's any data whatsoever—and bracket them with the Input Black and Input White carets. To "bracket" these controls means to adjust these controls inward so that each sits just outside its corresponding end of the histogram (see Figure 10).The result stretches values closer to the top or bottom of the dynamic range, as you can easily see by applying a second Levels effect and studying its histogram (see Figure 11).
Figure 10 Here's a perfect case for bringing in the triangle controls corresponding to Input Black and Input White to bracket the edges of the histogram, increasing contrast and bringing out vibrant colors without losing detail.
Figure 11 Adding a second Levels effect to this image's histogram only reveals the result of the prior adjustment; levels now extend to each end of the contrast spectrum.
Try applying Levels to any image or footage and see for yourself how this works. First crush the blacks (by moving Input Black well above the lowest black level in the histogram) and then blow out the whites (moving Input White below the highest white value). Don't go too far, or subsequent adjustments won't bring back that detail—unless you work in 32-bpc HDR mode. Occasionally a stylized look will call for crushed contrast, but this is generally bad form.
Black and white are not at all equivalent, in terms of how your eye sees them. Blown-out whites are ugly and can be a dead giveaway of an overexposed digital scene, but your eye is much more sensitive to subtle gradations of low black levels. These low, rich blacks account for much of what makes film look like film, and they can contain a surprising amount of detail—none of which, unfortunately, would be apparent on the printed page.
The occasions on which you would optimize your footage (making it look best) by raising Output Black or lowering Output White controls are unusual, as this change lowers dynamic range and the overall contrast. However, there are many uses in compositing for lowered contrast: to soften overlay effects (such as fog and clouds), for high-contrast mattes, and so on. More on that later in this article.
Problem Solving Using the Histogram
As you've no doubt noticed, the Levels histogram doesn't update as you make adjustments. After Effects lacks a panel equivalent to Photoshop's Histogram palette, but you can apply a Levels effect just for the histogram, if only for the purposes of learning (as was done in Figure 11).
The histogram reveals a couple of new wrinkles in the backlit shot from Figure 5, now adjusted with Levels to bring out foreground highlights (see Figure 12). At the top end of the histogram, the levels peak into a spike. This may indicate clipping and a loss of image detail.
Figure 12 In the first instance of Levels (top left), Gamma is raised and Input White brought in to enhance detail in the dark areas of the foreground (right). The second Levels instance is applied only to show its histogram.
At the other end of the scale is the common result of a Gamma adjustment: a series of spikes rising out of the lower values like protruding hashmarks, even though a 16-bpc project prevents quantization. Raising Gamma stretches the levels below the midpoint, causing them to clump up at regular intervals. As with crushing blacks and blowing out highlights, the net effect is a loss of detail, although in this case the spikes are not a worry because they occur among a healthy amount of surrounding data. In more extreme cases, in which there's no data whatsoever between the spikes, you may see a prime symptom of overadjustment, called banding (see Figure 13).
Figure 13 Push an adjustment far enough and you may see quantization, otherwise known as banding, in the image. Those big gaps in the histogram are expressed as visible bands on a gradient. Switching to 16 bpc from 8 bpc is an instant fix for this problem in most cases.
Banding is typically the result of limitations of 8-bit color, and 16-bit color mode was added to After Effects 5.0 specifically to address that problem. You can switch to 16 bpc by Alt-clicking (Mac: Option-clicking) the bit-depth identifier along the bottom of the Project panel (see Figure 14) or by changing it in File > Project Settings.
Figure 14 An entire project can be toggled from the default 8-bit color mode to 16-bit mode by Alt-clicking (Option-clicking) the project color depth toggle in the Project panel; this change prevents the banding seen in Figure 13.
Perfecting Brightness with Curves
The Curves control is particularly useful for gamma correction:
- Curves lets you fully (and visually) control how adjustments are weighted and roll off.
- You can introduce multiple gamma adjustments to a single image, or restrict the gamma adjustment to just one part of the image's dynamic range.
- Some adjustments can be nailed with a single well-placed point in Curves, in cases where the equivalent adjustment with Levels might require that you coordinate three separate controls.
Curves controls are worth understanding because they're a common shorthand for how digital color adjustments are depicted. The Curves interface recurs not only in all of the other effects-compositing packages, but also in more sophisticated tools within After Effects, such as Color Finesse (discussed briefly later in this article).
Curves does have drawbacks, compared with Levels:
- It's not immediately intuitive. Curves can easily yield hideous results if you don't know what you're doing, and plenty of artists are uncomfortable with it.
- Unlike Photoshop, After Effects doesn't offer numerical values corresponding to curve points, making it a purely visual control that can be hard to standardize.
- Without a histogram, you may miss obvious clues about the image (making Levels more suitable than Curves for learners).
The most daunting thing about Curves is clearly its interface, a simple grid with a diagonal line extending from lower left to upper right. The Channel selector at the top is set by default to RGB as in Levels, and some optional extra controls on the right help you draw, save, and retrieve custom curves. To the novice, the arbitrary map is an unintuitive abstraction that you can easily use to make a complete mess of your image. Once you understand it, however, you can see it as an elegantly simple description of how image adjustment works.
Figure 15 shows the more fully featured Photoshop Curves, which illustrates a little better how the controls work.
Figure 15 Photoshop's more deluxe Curves includes a histogram, built-in presets, displays of all channels together, and fields for input and output values for a given point on the curve.
Figures 16a–d show some basic Curves adjustments and their effects on an image. What you see in an image can be heavily influenced by gamma and contrast. Figures 17a–f use linear gradients to illustrate what some common Curves settings do. This array of Curves adjustments applied to a gradient shows the results of some typical settings. I encourage you to try these experiments on your own.
Figure 16a The source image.
Figure 16b An increase in gamma above the shadows.
Figure 16c A decrease in gamma.
Figure 16d Both corrections combined.
Figure 17a The default gradient and Curves setting.
Figure 17b An increase in gamma.
Figure 17c Figure 17c A decrease in gamma.
Figure 17d An increase in brightness and contrast.
Figure 17e Raised gamma in the highlights only.
Figure 17f Raised gamma with clamped black values.
More interesting are the types of adjustments that only Curves allows you to do—or at least do easily. I came to realize that most of the adjustments I make with Curves fall into a few distinct types that I use over and over, and those are summarized here.
The most common adjustment is simply to raise or lower the gamma with Curves, by adding a point at the middle of the RGB curve and then moving it upward or downward. Figure 18 shows the result of each. This produces a subtly different result from raising or lowering the Gamma control in Levels, because of how you control the roll-off (see Figure 19).
Figure 18 Two equally valid gamma adjustments employ a single point adjustment in the Curves control. Dramatically lit footage particularly benefits from the roll-off possible in the highlights and shadows.
Figure 19 Both the gradient itself and the histogram demonstrate that you can push the gamma harder (while still preserving the full range of contrast) with Curves rather than with Levels, where you face a choice between losing highlights and shadows somewhat or crushing them.
Figure 16b weights the gamma adjustment to the high end by adding a point to hold the shadows in place. The classic S-curve adjustment, which enhances brightness and contrast and introduces roll-offs into the highlights and shadows (see Figure 20) is an alternative method to get the result of the double curves in Figure 16d.
Figure 20 The classic S-curve adjustment. The midpoint remains the same, but contrast is boosted.
Some images need a gamma adjustment to only one end of the range—for example, a boost to the darker pixels, below the midpoint, that doesn't alter the black point and doesn't brighten the white values. Such an adjustment requires three points (see Figure 21):
- One to hold the midpoint
- One to boost the low values
- One to flatten the curve above the midpoint
Figure 21 The ultimate solution to the backlighting problem presented back in Figure 5: Adding a mini-boost to the darker levels while leaving the lighter levels flat preserves the detail in the sky and brings out detail in the foreground that was previously missing.
A typical method for working in Curves is to begin with a single point adjustment to adjust gamma or contrast, and then modulate it with one or two added points. More points quickly become unmanageable, however, as each adjustment changes the weighting of the surrounding points. Typically, I add a single point, a second one to restrict its range, and a third as needed to bring the shape of one section back where I want it.