< Previous | Contents | Next >

Using Text as a Mask

You can fill the text with a color or gradient, or you can use the text as a matte to cut the letters out of another image. First, we’ll drag another clip of a chalkboard covered with math from the Media Pool to the Node Editor as a disconnected MediaIn2 node.

Disconnecting and Reconnecting Nodes

If we start from the previous example that had a MediaIn as the background and the Text+ as the foreground to a Merge, we’ll need to do a little rearranging. Clicking the last half of the connection from the Text1 node to the Merge foreground input disconnects it.


image


image

image

Clicking the second half of a connection to disconnect it (top), and the result with the text node disconnected (bottom)


Connecting a MediaIn2 or Loader2 node onto the Merge1 node’s foreground input causes the entire viewer to be filled with the MediaIn2 (assuming we’re still viewing the Merge node). At this point, we need to insert the Text1 node’s image as an alpha channel into the MediaIn2 node’s connection, and we can do that using a MatteControl node.


image

The updated composite, with two video images connected and the text node disconnected

Using Matte Control Nodes

Select the MediaIn2 node, and click the Matte Control button in the toolbar to add it between the MediaIn2 and Merge1 nodes. (To tidy up, I’ve moved the nodes around a bit in the screenshot.)

The MatteControl node has numerous uses. Among them is taking one or more alpha channels, mattes, or images that are connected to the Garbage Matte, Solid Matte, and/or foreground inputs, combining them, and using the result as an alpha channel for the image that’s connected to the background input. It’s critical to make sure that the image you want to add an alpha channel to is connected to the background input of the MatteControl node, or the MatteControl node won’t work.


image

The second image properly connected to the MatteControl node’s background input


With this done, connecting the Text+ node’s output, which has the alpha channel, to the MatteControl node’s Garbage Matte input, is a shortcut we can use to make a mask, matte, or alpha punch out a region of transparency in an image.

image

Keep in mind that it’s easy to accidentally connect to the wrong input. Because inputs rearrange themselves depending on what’s connected and where the node is positioned (and, frankly, the colors can be hard to keep track of when you’re first learning), it’s key to make sure that you always check the tooltips associated with the input you’re dragging a connection over to make sure that you’re really connecting to the correct one. If you don’t, the effect won’t work, and if your effect isn’t working, the first thing you should always check is whether you’ve connected the proper inputs.


image


image

Option-dragging a node connection to drop onto another node exposes a node input menu

One alternate method of connecting nodes together is to hold down the Option key while dragging a connection from one node’s output and dropping it onto the body of another node. This opens a pop- up menu from which you can choose the specific input you want to connect to, by name. Note that the menu only appears after you’ve dropped the connection on the node and released your pointing device’s button.

Once the Text1 node is properly connected to the MatteControl node’s Garbage Matte input, a text- shaped area of transparency is displayed for the graphic if you load the MatteControl node into

the viewer.


image


image

image

Connecting the Text node to the MatteControl node’s Garbage Matte input (top), and the resulting hole punched in the image (bottom)


Customizing Matte Control Nodes

You can use the Inspector to change some parameters to get the result you want. In the Inspector controls for the MatteControl node, revealing the Garbage Matte controls exposes parameters for modifying how the Garbage Matte input is applied to the image. For example, you can choose to have the text mask filled with the image instead of cutting a hole in the image.