- Aug 19, 2010
Creating Alpha Channels
When do you make an alpha channel? Whenever you want to embed the transparency data into the flattened file. You worked hard for that transparency. Why throw it away? Think of an alpha channel as a stencil or mask. Most nonlinear editing (NLE) systems support some form of real-time alpha keying. It’s a good idea to use it.
While many NLE systems support Photoshop layers, it’s still a good idea to save flattened files with alpha channels. A TIFF or TARGA file with an embedded alpha channel gives predictable, consistent results.
Now you’re probably thinking, “My NLE system supports Photoshop layers and transparency. I don’t need an alpha channel.” Wrong. Support for layers and transparency is great, but you won’t get a perfect import. Even if your layer effects, grouping, and blend modes make it in (they won’t, by the way), do you really want a five-layer lower third? Talk about hogging tracks in the Timeline. I’m happy to have layer support, but I still pick a single, streamlined file 98% of the time. Sometimes you’ll want to animate or manipulate layers within the NLE system, but that’s why you always keep a layered design file to go back to. Proper use of alpha channels lets you change part of a composition without having to redo all your work.
Creating a “Perfect” Alpha Channel
Making a perfect alpha channel starts with having an active selection loaded. One easy way to create a perfect selection is to use a “targeted merge” approach. If you haven’t already extracted objects to their own layers, use the techniques described earlier in the chapter. Once everything is on extracted layers, you need to create a composite layer to generate the selection.
- Open the file Ch04_Lower_Third.psd from the chapter folder on the DVD.
- Turn off eye icons for all layers that shouldn’t be part of the alpha channel (in this case the Background layer).
- Create a new layer by clicking the New Layer icon at the bottom of the Layers panel and highlighting it.
- Hold down the Option (Alt) key, and choose Merge Visible from the Layers panel submenu.
- Now you have only one layer to load. Cmd+click (Ctrl+click) the composite layer’s thumbnail to create the marching ants. You can now throw away this layer.
- Switch to the Channels panel, and click the Save Selection as Channel icon (second from left). Make sure you have only one alpha channel for your document. (If you have more than four channels in an RGB+Alpha image, you have more than one alpha channel.)
- Save your native PSD file.
- Choose File > Save As, and choose a format supported by your NLE system. The most common formats are TIFF and TARGA. Make
sure the Alpha Channels and As a Copy boxes are checked.
Save the flattened file to the appropriate location. Then, when you close your layered PSD file, tell it to save changes. That’s it—no voodoo magic. Have a selection made, switch to the Channels panel, and save it.
Premultiplied vs. Straight Alpha Channels
You have to make some choices in Photoshop if you’re saving flattened files with alpha channels. It’s important to decide between premultiplied or straight alpha channels. This becomes an issue when you have soft edge effects, especially drop shadows and glows.
The alpha channel stored the transparency information as an 8-bit or 16-bit file. This grayscale file contains levels of opacity. The stars in the accompanying figure have a yellow glow applied to them. The star on the left is over black, a common background color used by video pros when building graphics. The star on the right (it’s really there) has been placed over a background that is the same color as the glow.
The star on the left is premultiplied; the glow is composited over black. The star on the right cannot be seen without enabling the alpha channel. The right star will generate better results when keyed over a video source.
When we create an alpha channel for these files, the shape is identical. The star over black, however, is considered premultiplied, a benefit when working in Photoshop so that you can see your work. The star on the right contains a straight alpha—that is, the alpha contains the glow info, but the background is a solid color that will become the glow when the image is keyed.
Notice how the premultiplied alpha picks up black around the edges? This is a subtle but nasty problem. It will show up when you have lightcolored glows or drop shadows. The second star, with a straight alpha, keys perfectly with no color contamination. To create a straight alpha channel, you must do one of the following:
- Place a solid color behind the objects that matches your glow or shadow.
- Place a copy of the photo behind the masked layer. This will allow the soft edges of the image to blend with the colors in the photo.
It’s a limitation that Photoshop cannot generate a straight alpha channel when saving a still image. (The File > Export > Render Video command can create moving footage with an alpha channel.)
While some programs, such as Adobe After Effects and Apple Final Cut Pro, will try to automatically compensate for a premultiplied alpha channel over a black or white background, it isn’t a perfect process. Although it is an extra step to create a straight alpha, it’s worth doing before saving your flattened files for video.
Combining Alpha Channels
You may find yourself working with an image that contains more than one alpha channel. This may be from a 3D software application or simply from the process of extracting a very complex image. Fortunately, Photoshop makes it easy to merge alpha channels.
Let’s try merging two alpha channels:
- Open the file Ch04_Additional.tif from the book’s DVD.
- Open the Channels panel, and view the two existing alpha channels.
- Choose Image > Calculations to launch the Calculations dialog.
- Set the Source 1 Channel to Alpha 1 and the Source 2 Channel to Alpha 2.
- Set the Blending mode to Linear Dodge (Add), which will combine the channels.
- Specify that you want the result to be a New Channel, and click OK. The new “merged” alpha channel is created.