Continuing where part I left off, it’s time to look at how we can combine the mattes that are output by several nodes using the Key Mixer node. It’s a long one.
Before getting started, let’s get a bit of terminology out of the way, first. When I talk about a matte, what I’m referring to is a grayscale channel that’s used to define which areas get corrected, and which areas don’t. However, using the terminology of DaVinci Resolve’s UI, it’s more accurate to refer to this as the “key channel.”
Why is this important? Because the technique of combining mattes is accomplished using the Key Mixer node, which takes multiple key channels as its input, allowing you to combine them in various ways in order to output a single key channel, which you can then plug into any other node’s “key input” with which to define a secondary operation.
This isn’t a technique you’re going to use every day. However, the following example shows what I consider to be one of the Key Mixer node’s primary uses, which is to allow you to create mattes that combine multiple HSL-qualified keys for shots where you simply can’t get satisfactory results from a single HSL key.
But enough jibber jabber. Let’s check out an example.
The following shot (which happens to be available on the DVD-Rom that’s included on my new book), has a single primary correction to adjust contrast and color.
However, the client wants to throw an orange-red wash into the room. Adding another node (to make it easier to back off this more stylistic correction in case the client changes his/her mind), we make the change.
Unfortunately, the amount of color the client wants gives the actors a sunburn, and changes the color of the man’s shirt from blue to a purple-pink that’s not quite what wardrobe had intended.
Now, one easy fix would be to apply the colored grade as a secondary operation, using HSL Qualification and Power Windows to isolate the skin tone of the faces, preventing the “accidental sunburn” look by limiting the correction to the outside of the secondary key.
Unfortunately, this does nothing to preserve the color of the shirt and tie, and in fact trying to isolate the oranges, maroons, and blues of these features all in one operation would require an impracticably wide sample. This is a perfect instance when combining several discrete keys will give us a better result.
To do so, we need to do some rewiring of our node tree, but to understand how we need to take another look at how node connections work. The following illustration shows the two types of node connections that you can make.
The circles at the top left and right are the targets used for routing RGB image data from one node to another, which is what we’ve been connecting nodes with so far. However, the triangles at the bottom right and left are the targets used for routing key channels from one node to another.
Connecting node 1’s key output to node 2’s key input lets you use the key from node 1 within node 2. However, this isn’t hugely interesting until we add another type of node to the mix.
Right-clicking within the Clip tab opens a shortcut menu, within which is a submenu you can use to create new, disconnected nodes. Within this list is a node called the Key Mixer.
The Key Mixer node can take multiple Key channels from several nodes (as many as you’ll practically need), combining them into a single key that you can then feed into another node to use for secondary correction.
You can probably see where I’m going with this.
Let’s go ahead and wire up the node structure we’ll need. First, we’ll use that shortcut menu to create a Key Mixer node and three Corrector nodes (corrector nodes are the same type of nodes that are used when you add Serial or Parallel nodes); essentially we’re adding one Corrector node for each feature we want to independently isolate using HSL Qualification.
Once the nodes are created, we want to drag connection lines from the RGB output of our original primary correction node 1, and connect them to the RGB inputs of the three Corrector nodes we’ve created. Note that one RGB output can feed as many RGB inputs of different nodes as you like.
Next, we want to connect the triangular Key outputs of the first two corrector nodes to the triangular key inputs of the Key Mixer node. You’ll notice that the Key Mixer node only has two inputs; if we want more, we need to create them by right clicking on the Key Mixer node and choosing “Add One Input” from the shortcut menu. You can add as may inputs as you need, they’ll all get crowded into the space at the left of the node.
With the extra Key input created, we can connect the last Corrector node’s Key output. Lastly, we want to connect the Key output of the Key Mixer node (which is outputting the sum of all keys that are input to it) to the Key input of the node that we had originally created to carry the “stylistic” color change. The result should look something like the following.
You should note that, until all of the nodes are properly connected, their thumbnails won’t reflect the flow of image data, instead showing the generic node icon. This lets you know which nodes are connected and having an effect, and which nodes aren’t.
With the node tree wired up, now all we need to do is key each element we want to isolate as tightly as possible. Another advantage of this technique is that each individual node can use a combination of HSL qualification and Power Windows to create an aggressive and well-isolated key.
With the faces, tie, and shirt independently isolated, selecting the Key Mixer node and turning on the Highlight checkbox in the Qualifier tab now shows us the sum total of all three keys added together. By default, the Key Mixer is set to combine all input Keys in an additive way.
Looking at the final result, we can see that while the stylized correction is still affecting the background, hair, and clothing of the actors, the areas we’ve keyed are now protected from this effect. This is exactly what we want, so we’re done.
However, that’s not the end of the story. Now, let’s take a look at how we can use the Key Mixer to subtract one node from another.
Using the image from Part I, we’ll recreate the same effect, this time subtracting an HSL-qualified key in node 3 from a Power Curve key in node 2, as set up in the following node tree.
When we first set this up, the two keys are automatically added together, just like in the previous example.
However, what we really want to do is subtract the faces from the “headroom shadow” shape in order to preserve the highlights on the actors. To do this, we’ll select the Key Mixer node and use the controls found in the Key tab.
The Key tab contains parameters that govern the keys that are connected to the Key Mixer node, specifically how they interact and whether or not they’re inverted. You’ll notice that there’s only one set of parameters even though there are two inputs coming into the node. This is because you need to select the connection line that corresponds to the node key you want to adjust in order to expose the parameters for that particular key.
After selecting the connection line attached to the second input (selected lines are yellow), the Key tab shows the parameters for INPUT LINK 2.
These parameters are similar to those found in the Window tab. In particular, clicking Mask (subtract from), and then turning on the Invert checkbox sets this input up to subtract itself from the other key connected to input 1.
The result can be immediately seen if we turn the Highlight checkbox on in the Qualifier tab.
At this point, we’ve got the matte we need, and we can select node 4 and lower the midtones to darken the above area. Unfortunately, the result is that the black portion of the key has gone darker, instead of the white portion. What’s up?
If you open up the Key tab while node 4 is selected, you’ll see two sets of parameters. The External Key parameters govern the behavior of keys that are routed to that node via the Key Input connection.
By default, the External Key parameters of new correction nodes have the Invert checkbox turned on. Turning this off correctly sets the node to darken the top region, rather then the bottom.
The resulting node tree thumbnails show how all the keys are interacting as they’re fed from node to node to node.
The end result, while in need of refinement, shows the correct effect.
And that’s all there is to it. Good grading!
Special thanks to Director Bill Kirstein for clips from Osiris Ford.