Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and applying transparency using alpha channels

Transparency Tricks

Creating and applying transparency using alpha channels

by  EdwardMartinIII  Posted    (Edited  )
By and large, AdobeÆs titler does a great job, especially if youÆre only playing with text or symbols-you-can-get-from-fonts (such as Zapf Dingbats, etc.) but undoubtedly, youÆve seen some of the moreà interestingà captions in such things as ôpop-up videoö, etc., where little shapes pop open, pulse like little hearts, fly around, or just generally make mischief on the screen while youÆre trying to watch an otherwise drivel-flavored music video.

Honestly, with some of the videos IÆve seen, canÆt say as I blame people for wanting to spice it up with dancing crap all over the screen. Sheesh û nothingÆs ever gonna be as cool as cave paintings, know what IÆm saying?

So, superimposing such images can be a real fun thing to do. The magic, of course, is to make sure that theyÆre all transparent however you like.

Now, most folks would first look at chromakeying, which is perfectly great, by and large. ItÆs served weather forecasters for millions of years (as long as they donÆt wear green ties). Chromakeying is great if youÆve got some long continually moving image you need to constantly key out, such as a weather reporter, or a small snub fighter on Hoth.

But letÆs say you only have a still image. For example, a caption that appears in a little spaceship, or a still image of Ray Walston holding up a finger as if he just had a brilliant idea. Surely Ray Walston deserves more than a crummy fuzzy chromakey. You know it and I know it.

If itÆs just a still, then you can add an ALPHA CHANNEL to it (assuming youÆre using Photoshop or some other application that understands how to add alpha channels). Alpha channels are awesome, and for stills, they kick chromakeying to the curb. Here, let me show you:

Open your picture in Photoshop. Find the layers palette. Probably on the right. Note that thereÆs a little tab on that thatÆll open the channels palette. Click on that tab.

Now youÆre looking at the CHANNELS in your image. There will probably be three: Red, Blue, and Green. This is because your image is composed of three colors. Get ready, the next part takes a mental leap.

In addition to COLOR information, the channel tab allows you to define other characteristics about your image. In this instance, weÆre going to make up a NEW channel for TRANSPARENCY.

Look at the bottom of the channels palette, and youÆll see the usual icons, such as a little trash can and a little notepad, for making a new (whatever). YouÆve seen this in layers, so you know what IÆm talking about. Click the little notepad to create a new channel and voila û a new channel appears (probably called ôalpha.ö)

Okay, this new channel is DIFFERENT than your color channels, so it might take a bit of getting used to. An alpha channel can only be shades of gray, from black to white and all shades of gray in between. Black means this part of the image will be completely transparent. White means this part of the image will be completely opaque. Gray means this part will be slightly transparent (depends on how close it is to black or white). So, for this image you have complete pixel-by-pixel control over transparency and the DEGREE of transparency.

(See what I mean!)

We continue our journey...

Now you have this all-black alpha channel. Great. Click back to the layers palette and go to your image. Use your usual selection tools to pick out everything you want to show on your video. So, for example, select your spacecraft, or your cartoon balloon, or Ray Walston. Feel free to feather your selection tool û it might look better. Use the lasso or the magic wand, or whatever you like. DoesnÆt matter. Just select the stuff you want to keep. And if you canÆt select it all, donÆt worry û you can do this little section repeatedly until you have exactly the image you want.

Got it all selected? Nice. (Took a while, huh? This is why using alpha channels is great for a still image, but if you tried doing it for a constantly moving image, you would be quickly driven insane)

Click the CHANNELS palette again.

Chances are, when you look at the channels palette, the three RGB layers have little eyes and the alpha channel doesnÆt. If thatÆs the case, click on the alpha channel and its eye will light up and all the other channels will go blind. Your workspace will appear black. DonÆt panic û you havenÆt caused any trouble û youÆre simply ONLY showing the alpha channel (which is all black).

You will also notice that your selection is still flickering along.

Do a quick check of your chosen colors. If you are editing an alpha channel, you can only fiddle with black, white, or gray, but for this, you want your foreground color black and your background color white. Make that the case if itÆs not already.

Okay, all set.

Keep an eye on your workpiece and press the DELETE key.

Shazam û all the black pixels you selected were yoinked! Now your selection appears as a big white mass in a black field.

This, I assure you, is A Good Thing.

You can peek at the alignment by clicking the eye of one of your channels (doesnÆt matter). This makes the color channel AND the alpha channel visible, and lets you dummy-check your alignment.

Now youÆve made an alpha channel.

Export that file as a PCT file, or a TARGA file. Those are the popular forms for video. When exporting those new stills, be sure that ôPreserve alpha channelsö is SELECTED.

Save your PSD file, close Photoshop, and open Premiere.

Open the Lame Music Video project.

Import your newly created file (the PCT or TGA file û although you could also import the PSD, I suppose û I just usually donÆt, because I work in ancient versions of the software and PSD import isnÆt as smooth a process as I would like.)

If you donÆt already have a video channel for superimposition, make one. Basically any video channel labeled 3 or higher is a superimposition channel. You need a layer numbered 3 or higher.

Place your new still on one of those higher numbered layers. DonÆt place it on layers 1 or 2. Layers 1 and 2 donÆt support transparency.

Right-click on the new still and select Video >> Transparency. Behold lots of interesting choices for transparency. Fiddle with all of those later, as they really are a lot of fun. For now, though click the ôShow all layersö (I think itÆs called that û it has an icon that looks like a little onionskin notepad with a sheet pried up) checkbox under the little preview window. Your preview will probably show only your still image. No worries!

For transparency type, check out all those options. The one youÆre looking for is going to be something like ôAlpha channel.ö YouÆll know it when you select it, because youÆll SEE the results in the preview window. DonÆt worry about any of the other settings at this point û the presumption is that you cut a perfect mask in Photoshop and so you donÆt want to jigger with it here.

Once you hook the right transparency type, click [OK] and go back to your editing window.

You can now do pretty much anything you want with that little still. You can make it pulse or fly around using the MOTION commands, you can apply effects to it, you can cut, trim, stretch, or do whatever you want with that clip. No matter how you mess with it, the alpha channel you cut in Photoshop makes all the ôbackgroundö of your still utterly transparent.

Ray Walston can even wear a green tie!

Bonus: If youÆre going to make a bunch of superimposed images that are all different in content, but all would have the same alpha channel mask, you can make a separate B&W image and tell Premiere (in the transparency control window) to apply a transparency mask that is in a completely different file. So, you could import ôCaption01.bmpö, ôCaption02.bmpö,... ôCaption87.bmpö. Eighty-seven captions?! Who wants to cut a new alpha channel for each one? Screw that û as long as the mask would be the same, all you have to do is import ONE mask as a B&W image called ôCaptionMask.pctö and then use THAT file as your mask for your eighty-seven captions. Takes a bit of fiddling to figure it out, but you will, especially if you end up trying to work out some complicated composition. Have fun!

BonusBonus: It's very possible you can import your PSD file (with empty layers and so forth) directly into Premiere. if so, then your workflow can be even slicker!

Cheers,

Edward
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top