Color Matching
Having examined the color-correction tools in depth, it's time for the bread-and-butter of compositing: matching foreground and background elements so that the scene appears to have been taken with the same basic light conditions.
Although it requires artistry to do well, this is a learnable skill with measurable objective results. The process obeys such strict rules that you can do it without an experienced eye for color. Assuming that the background (or whatever source element you're matching) has already been color-graded, you can satisfactorily complete a shot even on a monitor that is nowhere near correctly calibrated.
How is that possible?
As with so much visual effects work, the answer is derived by breaking down the problem correctly. In this case, the job of matching one image to another obeys rules that can be observed channel by channel, independent of the final, full-color result.
Of course, effective compositing isn't simply a question of making colors match; in many cases, that's only the first step. You must also obey rules you will understand from the careful observation of nature. And even if your colors are correctly matched, if you haven't interpreted your edges properly or pulled a good matte (or if such essential elements as lighting, camera view, or motion are mismatched), the composite won't succeed.
These same basic techniques will work for other situations in which your job is to match footage precisely—for example, color-correcting a sequence to match a hero shot (the one determined to have the right color juju), a process sometimes known as color timing.
The Fundamental Technique
Integration of a foreground element into a background scene often follows the same basic steps:
- Match overall contrast without regard to color, using Levels. When matching the black and white points, pay attention to atmospheric conditions.
- Study individual color channels and use Levels to match the contrast of each channel (as needed—not all images contain so fundamental a color imbalance).
- Match the color of the midtones (gamma), channel by channel, using Levels or Curves. This is sometimes known as gray matching and is easiest when an object in the background scene is known to be colorless gray (or something close).
- Evaluate the overall result for other factors influencing the integration of image elements—lighting direction, atmospheric conditions, perspective, grain or other ambient movement, and so on.
The overall approach, although not complicated or even particularly sexy, can take you to places your naked eye doesn't readily understand when looking at color. Yet, when you see the results, you realize that nature beats logic every time.
The sad truth is that even an experienced artist can be completely fooled by the context of the image. Figure 24 shows an example in which seeing is most definitely not believing. Therefore you shouldn't feel that working channel by channel is some kind of crutch. The results of your color adjustments undoubtedly will be challenged by other members of your production team, and when the time comes to review them channel by channel, it's pretty cool to be able to say you got it right.
Figure 24 There are no yellow dots in the top image and no blue dots in the center image. The four dots shown in the bottom image are identical to their counterparts in the other two images.
Ordinary Lighting
We begin with a simple example: inserting a 3D element lit with ordinary white lights into a daylight scene. As shown in Figure 25, the two elements are close enough in color range that a lazy or hurried compositor might be tempted to leave it as is.
Figure 25 An unadjusted foreground layer (the plane) over a day-lit background.
With only a few minutes of effort, you can make the plane look as though it truly belongs in the scene. Make sure that the Info palette is somewhere that you can see it. For now, choose Percent (0–100) in the Info palette's wing menu to have your values line up with the ones discussed here. (You can use whatever you want, of course, but this is what I'll use for discussion in this section.)
This particular scene is a good beginner-level example of the technique because it's full of elements that would appear monochromatic under white light (later we'll move on to scenes that aren't so straightforward). The background is dominated by colorless gray concrete, and the foreground element is a silver aircraft.
Begin by looking for suitable black and white points to use as references in the background and foreground. In this case, the shadow areas under the archways in the background, and underneath the wing of the foreground plane, are just what's needed for black points—they're not the very darkest elements in the scene, but they contain a similar mixture of reflected light and shadow cast onto similar surfaces, and you can expect them to match fairly closely. For highlights, you happily have the top of the bus shelter to use for a background white point, and the top silver areas of the plane's tail in the foreground are lit brightly enough to contain pure white pixels at this point.
Figure 26 shows the targeted shadow and highlight regions and their corresponding readings in the Info palette. The shadow levels in the foreground are lower (darker) than those in the background, while the background shadows contain slightly more red, giving the background warmth that's absent from the unadjusted foreground. The top of the plane and bus shelter each contain levels at 100%, or pure white, but the bus shelter has lower blue highlights, giving it a more yellow appearance.
Figure 26 The target highlight and shadow areas for the foreground and background are outlined in yellow; levels corresponding to each highlight (in percentage values, as set in the panel menu) are displayed in the adjacent Info palette.
To correct for these mismatches, apply Levels to the foreground and move the Output Black slider up to about 7.5%. This change raises the level of the blackest black in the image, lowering the contrast.
Having aligned contrast, it's time to balance color. Because the red levels in the background shadows are higher than blue or green, switch the Composition panel to the red channel by clicking the red marker at the bottom of the panel or using the Alt-1 (Mac: Option-1) shortcut, causing a thin red line to appear around the viewer. Now you can zoom in on an area that shows foreground and background shadows (see Figure 27).
Figure 27 Evaluate and match black and white levels, starting with RGB and then working on each color channel individually. In this case, the image is "green matched"; the RGB adjustment is all that's needed for the green channel (often the best channel to match, using RGB instead of its individual channel).
Black levels in the red channel are clearly still too low in the foreground, so raise them to match. Switch the Channel pop-up in Levels to Red, and raise Red Output Black slightly, to about 3.5%. You can move your cursor from foreground to background and look at the Info palette to check whether you have it right, but the great thing about this method is that your naked eye usually evaluates variations in luminance correctly without the numerical reference.
Now for the whites. Because the background highlights have slightly less blue in them, switch to the blue channel by clicking the blue marker at the bottom of the Composition panel or using Alt-3 (Mac: Option-3). Pull back slightly to where you can see the top of the bus shelter and the back of the plane. Switching Levels to the blue channel, lower the Blue Output White setting a few percentage points to match the lower blue reading in the background. Back in RGB mode—Alt-3 (Mac: Option-3) toggles back from blue to RGB—the highlights on the plane take on a more sunlit, yellow quality. It's subtle, but it seems right.
What about the midtones? In this case, they're taking care of themselves, because both the foreground and background are reasonably well balanced and these corrections are mild.
Figure 28 displays the result, with the same regions targeted previously, but with the levels corrected. To add an extra bit of realism, I also turned on motion blur, without yet bothering to match it precisely. The plane now looks more acceptably integrated into the scene.
Figure 28 This is a better match, particularly in the shadow areas; motion blur helps sell the color adjustment as well.
Work on this composite isn't done, either; in addition to matching the blur, you can add some sun glints on the plane as it passes, similar to those on the taxi. On the other hand, you can tell that the blur on the plane is too heavy for the pilot's absence from the cockpit to be noticeable, a good example of how an initial pass at a composite can save a lot of extra work.
Dramatic Lighting
Watch a contemporary feature film objectively for color, and you may be shocked at how rarely ordinary day-lit scenes such as the plane example occur. Dramatic media—not just films but television and theater—use color and light to create mood, to signify key characters and plot points, and more. Therefore, a scene dominated by a single color, such as Figure 29, is much more commonly found in dramatic films than it is in your everyday family snapshots. One of the main reasons that films take so long to shoot is that the cinematographer and lighting director require the time and resources to get the lighting the way it needs to be to create an image that is beautiful and serves the story.
Figure 29 This is the unembellished source lighting of this shot. (Image courtesy of Shuets Udono via Creative Commons license.)
The foreground element added in Figure 30 clearly doesn't belong in this scene; it doesn't even contain the scene's dominant color, and it's white-lit. That's fine; it will better demonstrate the effectiveness of this technique. Notice that both the foreground and the background elements have some areas that you can logically assume to be flat gray. The bridge has concrete footings for the steel girders along the edges of the road, while the can has areas of bare exposed aluminum.
Figure 30 Not only is it clear that the can doesn't belong in the color environment of the background; the mismatch is equally apparent on each color channel.
To play along with this game, you would apply Levels to the foreground layer.
Switch both your Composition view (Alt-1/Option-1) and the Channel pull-down in Levels to Red. The most challenging thing about this technique is remembering to keep both settings on the same color channel; using a four-up setup is probably worth the trouble.
Now, let's pretend that the red channel is a black-and-white photograph in which you're using the red channel of the Levels effect to match the foreground to the background.
Clearly, the foreground element is far too bright for the scene. Specifically, the darkest silver areas of the can are much brighter than the brightest areas of the concrete in the background. Therefore, adjust the gamma down (to the right) until it feels more like they inhabit the same world; in my example, I've adjusted Red Gamma way down to 0.67. Now cut down the red highlights a little; bring Red Output White down to about 92.5% or whatever looks right to you. The end result should look like a black-and-white photo whose elements match (see Figure 31, top image).
Figure 31 It's actually fun to pull off an extreme match like this channel by channel. The Levels settings used weren't really derived from the histogram, but by a mixture of looking for equivalent black/white/midpoints in the image, as well as just analyzing whether the result looks like a convincing black-and-white image on each channel.
Now move the Levels Channel and Composition view (Alt-2/Option-2) over to green. Green is the dominant color here, and its black contrast and brightness are much higher in the background. Therefore, raise Green Input Black to about 12.5% (for the contrast) and Green Gamma to something like 1.3 (Figure 31, middle). Better than copying my levels, try to find these on your own.
Finally, switch Levels and the Composition viewer (Alt-3/ Option-3) to the Blue channel. Whoa—there's almost no match here. The can is brighter and more washed out than the background. Again, the Input Blue Level must come up, to about 17.5%, but this time gamma has to come way down, ending up at about 0.45%. Now the can looks believably like it belongs there (see Figure 31, bottom).
It's strange to make all of these changes without ever looking at the result in full color. Go ahead and do that. Astoundingly, that can is now in range of looking like it belongs in that scene; defocus it slightly with a little fast blur, add a shadow, and you start to believe it. Make any final contrast adjustments on the Levels RGB Channel, and you have an impressive result that required no guesswork whatsoever (see Figure 32).
Figure 32 The result includes a subtle shadow that has also been color matched, as well as a final adjustment to the white contrast.
When There's No Clear Reference
The previous examples have contained fairly clear black, white, and gray values in the foreground and background elements. But life isn't always so simple.
Figure 33 shows a scene that lacks any obvious gray values to match; the lighting is so strong, it's hard to tell what color anything in the scene was originally, or whether there were any neutral black, white, or gray items in the scene.
Figure 33 What the heck is going on here? Again, the source image is as it was shot. Examine some of your favorite films, and you may find scenes lit this dramatically; the eye quickly becomes accustomed to strong shifts of color, but the color can also be used to strike a subconscious chord. (Image courtesy of Jorge L. Peschiera via Creative Commons license.)
The technique still works in this case, but it may require more in the way of trial-and-error or artist's intuition. Looking at each individual color channel, only green is even close to a plausible match right off the bat; the red channel contains blown-out whites, and the blue channel is so dark (and grainy) that it hardly exists.
Again, just try to get the brightness and contrast adjusted, working channel by channel, and you get an initial result something like that in Figure 34. Considering how subjective the adjustments are (by necessity) in this case, this isn't half bad, and fine adjustments to the RGB channel can bring it to where it needs to go.
Figure 34 This one requires as much intuition as logic, but adjusting it channel by channel still yields a striking result.
The ability to match color without seeing an image in full color is so powerful that it can seem almost magical the first few times you try it. Why, then, do so few artists work this way? I would have to say that laziness and ignorance are the main culprits. Switching channels seems like a pain, and few untrained artists clearly realize that color works like this.
Gamma Slamming
Maybe you've seen an old movie on television—the example I think of first is Return of the Jedi (before the digital re-release)—in which you see black rectangular garbage mattes dancing around the Emperor's head, inside the cloak, that you obviously shouldn't be seeing. Return of the Jedi was made prior to the digital age, and some of the optical composites worked fine on film; but when they went to video, subtleties in the black levels that weren't previously evident suddenly became glaringly obvious.
Don't let this happen to you! Now that you know how to match levels, put them to the test by slamming the gamma of the image. To do this, you need to make a couple of adjustment layers. I usually call one slam up and the other slam down, as in the examples. Be sure that both of these are guide layers so that they have no possibility of showing up in your final render.
To slam up, apply Curves with the gamma raised significantly (see Figure 35). This technique exposes any areas of the image that might have been too dark to distinguish on your monitor; if the blacks still match with the gamma slammed up, you're in good shape.
Figure 35 Slamming gamma is like shining a bright light on your scene. Your black and midtone levels should still match when viewed at these extremes.
Similarly, and somewhat less crucially, you can slam down by lowering the gamma and bringing the highlights more into the midrange (see Figure 36). All you're doing with these slams is stretching values that may be difficult for you to distinguish into a range that's easy for you to see.
Figure 36 If in doubt about the highlights in your footage, you can also slam the gamma downward. Here, the slam makes it clear that the highlight reflected in the can is not as bright or bloomed as the overhead lights, and a lack of grain in the foreground becomes apparent.
This method is useful anywhere that there's a danger of subtle discrepancies of contrast; you can use it to examine a color key, for example, or a more extreme change of scene lighting.