- This chapter is all about color correcting keyed layers to achieve a photorealistic composite. We'll start by understanding what different color correcting operations do to both the pixels and the picture, see the differences between the grade and color correct nodes, the effect of premultiply and unpremultiply on color operations, then finally, a best practices workflow for dialing in photorealistic composite. This video is about how the math of color correction affects the pixels in the picture.
The capable compositor must understand both what the color ops do to the code values as well as their affect on the appearance of the image. So here's our setup. I've got this ramp attached to a grade node to a sampler node which will plot the code values across the ramp. Right here where this sampler is, straight across, so we see a linear ramp from zero to 1.0, going from left to right. Now, I'll float this grade node here.
If I for example raise the gain, watch the viewer now as the ramp gets brighter, and then I can resample, and there's my new curve. So the ramp and the sampler are just showing us what's happening to the code values but not the picture itself. So, let's change the setup just a bit. I'll come over here. Now these two grade nodes are cloned, so whatever I do to this grade node will also happen to the ramp and the display. Very nice. Okay.
So, let me float this grade node, restore the gain back to default, and resample to show the normal curve. So if I do a gain down, as you can see as I move the slider my picture gets darker. So what's happening is, I'll stop right here at .66, that means every code value is being multiplied by .66. So if I resample here, you can see darker. Except for zero, all the code values are now darker, and 1.0 is now .66.
I'll restore that back to normal and resample. Now the multiply slider does the exact same thing as gain, mathematically. I think they have the two of them because a colorist would think in terms of gain, whereas a compositor, who maybe wanted to double the density of his alpha channel, might use a multiply. But be assured, mathematically and visually, they do the same thing. So, let's take a look at lift. I'm going to apply a lift of .1, watch what happens to my picture.
Boom, all fogged up in the blacks. Well, let's see why. We'll resample and there it is, right there. You see the lift raised the blacks a lot. A little bit on the mid-tones, and nothing up here. In fact, the lift is scaling the code values around 1.0, this line here. Watch what happens if I tap up my lift, sample, tap up my lift, sample.
Okay, you can also go negative. If I do a minus .1 on the lift and sample, you can see that .1 has been pulled down to zero, resulting in all these black pixels up here, and you can see in the RGB values down here that those are zeros. But, if I turn off the black clamp, which is by default on, resample, my negative code values appear.
And we cruise up to the viewer and sure enough, now I've got negative code values. Normally speaking, when you're working with RGB images, you normally want the black clamp on, resample, and the white clamp off. You want the white clamp off because you don't want to be clipping any high dynamic range images that go above 1.0. If you're working with mats or keys, you want both clamps on, because you don't want any code value below zero or above 1.0 for a mat or a key.
However, if you're working with log images, you might want to turn the black clamp off so you don't clip out the negative code values that are inherent in log images. But I'm turn that back on because that's the normal flow, rehome my lift, and resample my frame. Now let's take a look at offset. Offset adds a constant code value across the picture, so the whole picture will get brighter and especially the blacks when I click, and then when we sample this, watch, the curve will pop up uniformly from black to white, so.
You can also of course go negative. We'll reset that, resample. Gamma: gamma down, it gets dark, gamma up it gets light. They like to say it affects the mid-tones. If I come down here to a gamma of .55, my image obviously got darker. Let's check out the curve. Gamma is a power function. It applies a mathematical algorithm to all the code values. The key issue is, that the zero and one are untouched by a gamma operation.
We can actually see how much the curve has bent if I'll turn off that red guy there, so this is the, the red channel is not affected by the gamma, but blue and green are, you can see how much it actually affects them. Keep in mind that in NUKE's linear light space, your mid-tones, your mid-grays are right here at .18. Not up here at .5 like you might expect with a Photoshop or After Effects. If I gamma up and turn on the red, the picture obviously got a lot brighter, and now my curve goes the other way.
Set that back to default and resample to take a look at the black point and the white point. Now we can see that best, let me change my setup a little bit here, we come over here to the ramp and I'll float this grade node here. Okay, we're talking about the black point and the white point. Whatever code value appears in the white point box is pulled up to 1.0 or down to 1.0, depends on whether you sample above or below.
So to demonstrate the white point, I'm going to turn on the eyedropper for sampling the screen, come up here and find a .5 right there, ALT, CMD or CTRL, click, and I pulled .5 up to 1.0. We can see it over here in the sampler. We'll bring that down. My .5 code value here got pulled up to 1.0 there, which of course blasted everything up higher. So we'll just put that back to default, and resample.
Now the black point, whatever code value appears in here, is going to be pulled down to zero black. So, if I enable the sampler for the black point, come up to here and let's say I cruise around looking for .2, get as close as I can, and I sample that with an ALT, CMD or CTRL, click, .2 got pulled down to zero. Check in the graph, there it is. Because my black clamp was on, no negative code values.
Turn it off, there they are. Let's turn it back on, that's kind of scary. So what's this good for? When you have a film scan, came off the scanner, it could be overexposed or underexposed, so you can select a point in the screen and set that to white, and then select another point in the screen and set that to black, and that's for color grading a film scan. Now let's take a look at saturation. Now that's a completely different story.
We'll close this, pick up our toys, and move over here. Let me clear my property bin, open up this sampler node, and let's float our saturation property panel here. Let me resample my sampler here, there we go. Okay, the sampler is set right here, and its scanning this entire scan line here to our graph, so you can see the code values, red, green, and blue, and how different they are, and over here this flat spot here where they're all the same is this gray patch right there.
So the essence of saturation is, if I desaturate the picture, I move the code values closer and closer together. If I desaturate it completely, all three code values, red, green, and blue, land on top of themselves to make a perfect grayscale image. So let's take the saturation to .5, watch the viewer, we lose most of our color, it's still a little bit of color in there, you can see that, but now let's resample and watch the curves jump closer together. Okay, let's try it down to a saturation of .2, picture gets even more pale, curves jump even closer together, and then if I take the saturation to an actual zero, the curves land on top of each other.
There they go. There you can see there's the blue, and the green, and the red, they're all right on top of each other. I'll put that back to default, resample, just to show you the obvious that if I increase the saturation, it's going to drive the curves further apart. Hopefully this little demonstration will help you to map the color correction operation to its effect on the code values and the resulting image. You can do color correction with both the grade and the color correct nodes, but they do have completely different capabilities and purposes, which are revealed in the next video.
Note: This course was created by Steve Wright, author of the seminal book, Digital Compositing for Film and Video. We are proud to host this course in our library.
- Creating an uber key
- Keying green-screen vs. blue-screen footage
- Preprocessing footage
- Building a clean plate
- Making luma keys
- Keying on hue and saturation
- Pasting keys together
- Grain management
- Saving time with garbage mattes
- Using spill suppression
- Improving edges
- Color correcting keys
- Sweetening the comp
- Alternative compositing workflows
- Fixing edge problems
- Using KEYLIGHT, Primatte, Ultimatte, and other tools