PLEASE NOTE that I no longer endorse the Photoshop masking method referenced below.
Although it still works, more recent versions of Photoshop offer different and, IMO, far better ways to create masks for your videos, ways which don't necessarily have anything to do with action scripts. The basic use of an Action script in Photoshop remains a valuable tool, however, so I hope people still find this guide useful. (PM me if you want detailed instructions for my current tried and true Photoshop masking method)
. I am always happy to answer any questions about Photoshop and help with projects or techniques people are having trouble with, so please don't hesitate to PM me for assistance anytime!
In the (locked) thread on masking in this forum
there is a very old, but very thorough, step-by-step guide to creating masks in Photoshop. There is a better way, one that alleviates about 80% of the work inherent in that method: you let Photoshop make a lot of the mask for you by creating an Action script which completes much of the process via automation. The only work required on your part, once things are properly set up, is defining the transparency in each frame.
Creating custom action scripts in Photoshop is not at all difficult. Basically, you just need to have a tried and true method for achieving the results you want, then record that method and play it back whenever you need those results. The masking method suggested in the thread mentioned above works nicely as an action script if you alter the progression of steps just a tad and take some extra precautions preparing your files for processing.
I'm going to assume people know their way around Photoshop for this: 1. Bring an image you wish to mask into Photoshop, be it a frame from a video editing program or something from somewhere else.
2. With the pen tool, create a workpath around the area to be masked, then turn it into a selection. As described in the masking thread, at this point "marching ants should be marching around the borders of your cutout." PEN TOOL? you shriek in horror…yeah, pen tool. Immerse yourself in my easy-to-follow, overly thorough guide to getting over pen tool fear and hatred and then go on to step 3.
3. Save this selection with some generic, easy-to-remember name that will never be used for another selection.
4. Save the file as a Photoshop (PSD) document, making darn sure to label it appropriately so that, for example, if it's the first in a series of 52 frames you intend to mask, you know it's frame one.
5. Make your action script (this can actually be done ahead of time, it doesn't matter as long as it gets done before you go any further than assigning a selection area to a whole bunch of files. I also recommend you do this before creating selections for 51 more frames only to find out that your selection-creating method isn’t going to cut it).
To make an action script, again, all you need to do is record the steps you take to achieve certain results. There's no Visual Basic or Java involved - most graphic designers abhor math, after all. Photoshop comes with a fantastic script-making application just for this reason, which is actually loaded up already with a lot of useful stuff (more details can be found in Photoshop Help, btw). How to make an action script:
1. Practice what you plan on doing to create a mask; in other words, make sure your method works. I’m harping on this because there can be unforeseen glitches, wrong choices and oversights that come out of nowhere and ruin everything, no matter how many times it's worked before. Believe me, this is one reason I LOVE scripted masks, I never ever EVER will screw it up again. Of course, also be sure that your mask produces the results you want in your video editing program.
2. When you’re ready to record your script, open up whatever that file with the selection was that you saved as a PSD.
3. I’m assuming you have a default Photoshop workspace on deck, so your Action palette will be under your History palette. Bring it forward and take a look at what’s there – lots of scripts.
4. At the bottom of the Action palette, click on the “create new action” icon (looks like the new layer icon). I personally go the further step to create a special folder/set for custom actions, but that’s just because I’m hyper-organized – or pretend to be.
5. A new window will open, asking you to name your action and listing a few other options. Name this action “AMV Mask” or some such thing that will be easy to identify and then hit “Record.” The little circle on the Action palette will turn red. Don’t freak out, this isn’t like a screen capture program that’s going to stalk your every movement. Nothing’s getting recorded until you give Photoshop a command – you can look under menus, scroll around your image and wander away from your computer for hours if you want.
6. If you’re using the masking guide from the other thread, you’re going to be starting the script from Step 6 with one major difference. Instead of using the magic wand tool to assign a selection area, you’re going to use that selection you saved. So, for the first action in your script, load the selection, making sure “New Selection” is checked off in the dialogue box.
7. Continue with your mask-making plan, substituting your saved selection whenever necessary for any magic wanding it mentions. (Magic wand bad…BAD). By the end of the process, you should have a nice mask sitting in front of you.
8. When you’re done, save the file in whatever format you intend on bringing into your video editing program – JPEG, PSD, etc.
9. Close your JPEG, PSD, or whatever file your mask resides in.
10. Stop recording the script by hitting the little square on the bottom of the Action palette.
11. Assuming everything went ok and you were happy with the mask-making process you just went through, test your script out on that original PSD file you just used to make a mask. For beginners, the most obvious way to do this is to just revert/reopen that original PSD, go to the Action palette, select your mask script and then hit the little triangle at the bottom of the palette. Before your stunned and grateful eyes the entire masking process should play out in warp speed.
Now, back to the grunt work. Chances are pretty good your mask script didn’t turn out right because it’s quite a fussy process and there’s all kinds of things that can go wrong. Identifying where the problems lie and repairing the damage can be tedious, but so is masking frames by hand and at least this way there’s an end in sight! Fixing a script can be done either by completely recording the process all over again or by going in and selectively deleting the bad steps and inserting/recording new ones. See the Photoshop Help section for more on this. 6. If you’re really sure your mask script works, that it gives you exactly the results you want, go ahead and create selection areas for all the other frames you need to mask following steps 1-4 above. Here’s the trick that makes this all work, though: you must save your selection under the same name each time. Why? Because your action script has been programmed to load a selection with a certain name, so as long as that selection exists in your numerous PSD files, it’s going to be able to work with it.
7. Now for some really nice stuff that will save you even MORE time! Instead of opening each of your 52 selection-inclusive PSD files one after another and running the script on them one after another – or even opening them all at once and doing so – let Photoshop handle this.
a. Close all your PSD files.
b. If you’ve not already done so, move those PSD files into their own folder somewhere.
b. In Photoshop, go under File>Automate>Batch
c. Select your script from the drop down menu and under Source choose “Folder.” A new menu will activate, and “Choose…” will let you point Photoshop towards that folder where all your PSD files are waiting.
d. Mess around with the four options under “Choose…” if you want.
e. Assuming your action script included a Save As and Close command at its end, you can leave the Destination field set to “None” or assign a folder into which all these masked files should be put. If your script didn’t end that way, you can explore the various options here for outputting your masked file. Just be careful NEVER to save over your original PSD file.
f. When all your options are set the way you want them, just hit “OK.” And as Emeril would say, BAM! Photoshop will open, process, save and close all your target files for you. You’re done!
This scripting process can be customized for any other mask-making method that can rely on a constant (in this case, your saved selection) across multiple files.
Now, why did I emphasize saving your PSD files for a rainy day? Because mass production tactics like this do not allow you to double check on the conveyor belt whether everything is coming out pretty.
When the script is done processing your files, you need to take a good hard look at each one to be sure the masks appear the way you intended. If some don’t, go back to your original PSD files and make the necessary changes, toss out your saved selections in favor of the new mask-to-be area and then run the script again. I generally do not run the mask script on more than 10 files at a time unless I’m 100% sure what it will produce is exactly what I’m after (like each frame has the exact same selection area and I know that area is perfect). Fixing the selection areas on 10 files can take awhile, depending on the extent of work to be done, and since you’re going to have to recheck the masks on those AGAIN…well, I’d rather deal with 10 files at a time than 52.
Once again - sorry but it’s true - the pen tool is the only thing you should ever be using to create masks. It is extremely fast and easy to fix bad masks if you’ve used the pen tool to create a selection area (and did other things you were supposed to, see my tutorial for the nitty gritty) – if you didn’t and went the route of the magic wand or lasso, you’ve made a lot of unnecessary work for yourself and scripting masks is not going to be as painless as it should be.
It's also worth mentioning that you may need to make a new mask script every time you tackle files from a different source - there are some variables in the process that sometimes throw things out of whack. What works on one kind of image may not work for another.