Chapter 16
IN THIS CHAPTER
Working with Actions and the Batch command
Using the new Search panel
Creating contact sheets and PDF presentations in Photoshop
Scanning multiple images in one pass
Scripting in Photoshop
A lot of the work that you do in Photoshop is fun — experimenting with filters, applying creative adjustments, cloning over former in-laws, that sort of thing. A bunch of your work, though, is likely to be repetitive, mundane, and even downright boring. That’s where automation comes in. If a task isn’t fun to do, if you need to speed things up, or if you need to ensure that the exact same steps are taken time after time, automation is for you.
I begin the chapter with a look at Photoshop’s Actions and the Batch command, which enable you to process many files automatically. I’ll then introduce the new Search feature. Next, I take a look at PDF Presentation and Contact Sheet II (used to show and print multiple images on a single page). Following those two powerful features, I show you the Crop and Straighten Photos feature, a neat way to effectively scan multiple images into Photoshop in a single pass. After that, I give you a quick look at scripts, such as the very powerful Image Processor. Scripts are sort of little computer programs that you use to control your computer — Photoshop, other programs, your printer, or even an operating system itself.
In Photoshop, an Action is simply a recorded series of steps that you can play back on another image to replicate an effect or technique. To choose a wild example, say that every image in your new book about Photoshop needs to be submitted at a size of exactly 1,024 x 768 pixels at 300 ppi, regardless of content. Record an Action that uses the Image Size command to change resolution and then use the Canvas Size command to expand the image to 1,024 x 768 pixels. Use that Action (play the Action) on each image before submitting it. Better yet, wait until all the images for a chapter are ready and then use the Batch command to play the Action automatically on each of them!
Actions and the Batch command not only streamline repetitive tasks; they also ensure precision — that every one of those images will be exactly 1,024 x 768 pixels, each and every time. But Actions also have a creative side to them. The lower part of the Actions panel’s menu (see Figure 16-1) contains sets of Actions that you can load into the panel to produce frame and border effects, text effects, and more. (The content of your Actions panel menu will differ from what’s shown in Figure 16-1.) You can also purchase collections of Actions from commercial sources.
FIGURE 16-1: The Actions panel menu includes sets of Actions you can load into the panel.
To work with an Action, open an image, select the Action in the Actions panel, and then click the Play button at the bottom of the panel. (The three buttons to the left use the near-universal symbols for Stop, Record, and Play; the three to the right use the standard Adobe symbols indicating New Set, New Action, and Trash. Refer to Figure 16-1.)
Any step in the Actions panel that doesn’t have a check mark in the left column is skipped when you play the Action. Any step that has a symbol visible in the second column (the Modal Control column) pauses when you play the Action. Click in the second column when you want the Action to wait for you to do something. Perhaps you’ll click in that column next to a Crop step so that you can adjust the Crop tool’s bounding box. You might click in the second column next to an Image Size step so that you can input a specific size or choose a resampling algorithm. After you make a change or input a value for that step, press Return/Enter to continue playing the Action.
If you get hooked on Actions, you’ll also want to try Button Mode in the Actions panel menu. Each Action appears in the panel as a color-coded button. You don’t see the steps of the Action, so you don’t know whether an individual step is being skipped and you can’t change the Modal Control column, but you might like the color-coding to sort your Actions.
The real power of Actions comes when you record your own. Sure, the sets of Actions included with Photoshop are great, and the commercial packages of Actions have some good stuff too, but it’s not your stuff. When you record your own Actions, you record the steps that work for your images, your workflow, and your artistic vision.
Actions can’t float free in Photoshop’s Actions panel: Each Action must be part of a set of Actions. Before beginning to record your Action, you can select an existing set or click the fourth button at the bottom of the panel to create a new set. When you have a set selected, you can then click the New Action button (second from right). Then, in the New Action dialog box that appears (as shown in Figure 16-2), assign a name (and color-code for Button Mode and perhaps choose an F-key combination as a keyboard shortcut for playing the Action) and click the Record button. From that point forward, just about everything you do in Photoshop is recorded as part of the Action until you click the Stop button at the bottom of the Actions panel. No worries, though — you can always delete unwanted steps from a recorded Action by dragging them to the Trash icon at the bottom of the Actions panel. And if you want to change something in the Action, you can double-click a step and rerecord it.
FIGURE 16-2: After you click the New Action button, you see the New Action dialog box.
Fit Image specifies a maximum width and height that the image being processed must not exceed, regardless of size or shape — great for batch-processing images for the web. Fit Image maintains your images’ aspect ratios (to avoid distortion) while ensuring that every image processed fits within the parameters you specify. (See Figure 16-5.) If you need all landscape-oriented images to be 800x600 pixels and all portrait-oriented images to be 600x800 pixels, enter 800 in both the width and the height fields.
Notice the Don’t Enlarge check box in the Fit Image dialog box. If you’re prepping images for a website and reducing them to a specific size to make them download and display faster, you don’t necessarily want to enlarge some of the images, making them download slower. Disable this option when you’re trying to make all the images uniform in size, perhaps for the creation of a PDF presentation (discussed later in this chapter).
FIGURE 16-3: Using Insert Menu Item leaves a dialog box open when playing the Action.
FIGURE 16-4: Insert a Stop to show a message when the Action is played.
FIGURE 16-5: Insert Conditional is accessed through the panel menu, Conditional Mode Change and Fit Image are recorded in Actions using the File ⇒ Automate menu.
The Actions panel menu also offers the Allow Tool Recording option. This feature enables you to record tools such as the Brush and the Clone Stamp in Actions. However, there are a few limitations. While you can record the tool, you can’t record changing its settings. If, for example, you recorded the Action using a feathered 40-pixel brush tip, you’ll need to remember to select that brush tip prior to playing the Action. In addition, the data recorded for the tool movement is device-specific. If you record the Action on one computer and play it back on a computer using a different video card and/or monitor, the results may be slightly different. Do not depend on Actions that record tool movement for precision!
Choosing File ⇒ Automate ⇒ Batch lets you play back an Action on a number of files. You select an Action to play and also a folder of image files to play it on; then you decide what you want to do with the files after the Action finishes with them. You can leave the images open in Photoshop, save and close them, or (much safer) save them to another folder, preserving the originals. Figure 16-6 shows the Batch dialog box and also the pop-up menu for the fields in the File Naming area. (When you select a new folder as the Destination in Batch, you must tell Photoshop how you want the new files to be named.)
FIGURE 16-6: The Batch command is much simpler than it looks!
You must remember three things when assigning filenames:
Don’t use a period (.) in any field. You can type in any of the fields (except the last one you use), but for compatibility, stick with letters, numbers, underscores (_
), and hyphens (-).
Absolutely do not use a period (.) in the filename. The only period that should be used in a filename is the one that’s automatically added immediately before the file extension. Including a period earlier in a filename may make that file unrecognizable for some programs.
FIGURE 16-7: Some folks will get hooked on this new feature!
Presentations and contact sheets are great for showing off your work. Rather than opening an image, showing it, closing, then opening the next image, you have them in a simple presentation format or, with contact sheets, multiple images on a single page. (Contact sheets are also great for printing multiple images on a single sheet of paper.)
Portable Document Format (PDF), the native file format of Adobe Acrobat, is an incredibly useful and near-universal format. It’s hard to find a computer that doesn’t have Adobe Reader or another PDF-reading program (such as the Mac’s Preview), and that helps make PDF a wonderful format for sharing or distributing your images.
You can quickly and easily create both on-screen presentations (complete with fancy transitions between images) and multipage PDF documents (suitable for distribution and printing) by choosing File ⇒ Automate ⇒ PDF Presentation. (See Figure 16-8.)
FIGURE 16-8: PDF is a great format for sharing images as presentations or as documents.
To create a PDF presentation or a multipage PDF in Photoshop, take the following steps:
If the files you want to use aren’t already open in Photoshop, click the Browse button. You can click and then Shift+click to select a series of images or ⌘ +click (Mac)/Ctrl+click (Windows) to select individual images.
Hint: You must select the individual images; you can’t select only the folder.
After you click the Open button, the filenames appear in the PDF Presentation window. Drag filenames up or down to reorder them.
If, for example, you have a number of images open in Photoshop and select the Add Open Files and the files don’t open in order of filename, you can click the new Sort By Name button to re-sort the files in the left column.
In the Output Options area, you can elect to create an on-screen presentation or a multipage document.
You can choose to have a white, gray, or black background and what file-related information you want on each slide or page. Electing to include the filename (and perhaps your copyright information) is a good idea when sending images to someone who needs to know the image name, say, to order prints and give you cash for them. A multipage PDF is an excellent way to share a large number of images; a presentation is a great way to show off your work.
Select how you want the presentation to play.
You can have the presentation automatically switch images after a given number of seconds (or opt for manual slide advance), you can have the presentation automatically rewind and begin playing again (loop), or you can pick transitions between images. Do your audience a favor and pick a single transition and stick with it — preferably one simple transition, such as Wipe Left or Wipe Right. Those too-busy transitions are the 21st-century version of PowerPoint clip art — fun to play with, but distracting to your audience.
Click the Save button.
You see the Save dialog box, from which you pick a location and a name and then click another Save button.
In the Save Adobe PDF dialog box, make things simple for yourself and choose Smallest File Size or High Quality Print from the Adobe PDF Preset pop-up menu at the top.
If you’re creating a presentation or want to create a multipage PDF from which the recipient can’t print full-size images, choose Smallest File Size. For a multipage document from which you do want the client to print great images, use High Quality Print.
The only other area of the dialog box that you really need to consider is Security.
You can assign a password to the file that the recipient needs in order to open and view the presentation or multipage PDF document. Alternatively, you can require no password to open the file, but rather assign a password for printing or changing the file.
In the old Dark(room) Ages, photographers regularly made a record of which images were on which film strips by exposing those strips on a piece of photographic paper, thus creating a contact sheet (the film strips were in contact with the sheet of paper). The contact sheet serves the same purpose as thumbnails or previews in Bridge or the Open dialog box or thumbnail images on a web page — they show which image is which. Hard copy contact sheets are useful to present to a client. You can have Photoshop automate the process for you by choosing File ⇒ Automate ⇒ Contact Sheet II. (See Figure 16-9.) The procedure is as follows:
(Optional) If you want to include the images in any subfolders that might be within that folder, select the Include Subfolders check box.
The Group Images by Folder option starts a new contact sheet for each subfolder.
Select a resolution.
I recommend 300 pixels per inch (ppi) if printing and 72 ppi if you’ll be slicing the image for your website (although resolution really doesn’t matter for most web browsers).
FIGURE 16-9: If you need a printed record of your images, consider Contact Sheet II.
You can choose to have the images added to the page row by row (the second image is to the right of the first) or column by column (the second image is directly below the first). You can also choose the number of rows and columns, which determines the size of each individual image. You then need to decide whether to use auto-spacing, to calculate the spacing between images, and whether to rotate images. If your source folder has a mixture of landscape and portrait images, rotating makes sure that each is exactly the same size — although some will be sideways. If image orientation is more important than having identical sizes, don’t use the Rotate for Best Fit option. Note in Figure 16-10 that the filenames change size to match the size of the image and, as you can see at the far right of the second row, if the filename is too long, it gets truncated rather than shrinking to an unreadable size. When you have elected to include filenames as captions, Contact Sheet II lets you choose any font installed on your computer for the filenames.
FIGURE 16-10: To maintain image orientation, don’t use the Rotate for Best Fit option.
You can often save a lot of time by placing multiple photos on the glass of your scanner and scanning them all at once. You don’t need to reopen the scanner software or generate a new preview every time; rather, you just scan one big picture and make individual little pictures from it later in Photoshop. Photoshop’s File ⇒ Automate menu offers a neat timesaving feature named Crop and Straighten Photos, which generates a separate file for each photo it finds in the scan.
FIGURE 16-11: Use a contrasting background to help Crop and Straighten Photos find edges.
After the scan is complete and the image is open in Photoshop, choose File ⇒ Automate ⇒ Crop and Straighten Photos. No dialog box, no submenus — just select the command and wait a few seconds while Photoshop identifies the individual scanned images and creates a separate file for each.
You can use AppleScript (Mac), Visual Basic (Windows), and JavaScript (both) with Photoshop. Scripts are much more powerful than Photoshop’s Actions because they can control elements outside of Photoshop itself. AppleScripts and Visual Basic scripts can even run multiple programs and play JavaScripts. You can find plenty of information to get you started in books and videos available on the web.
If you shoot in your camera’s Raw format, perhaps the most useful of the several pre-recorded scripts installed with Photoshop is Image Processor. (See Figure 16-12.) Choose File ⇒ Scripts ⇒ Image Processor to batch-convert your Raw images to JPEG, PSD, or TIFF — and you can even resize the images automatically while converting! (And while Image Processor is designed to work with Raw files, you can actually convert any file format that Photoshop can open.)
FIGURE 16-12: Image Processor can batch-convert to speed your workflow.
Image Processor is much simpler than it appears:
Choose a destination. You can save the files in the folder of origination (and even maintain the subfolder structure), or you can click the button and select a different folder in which to save the processed images.
Do not click the Select Folder button and select the source folder. If you want to keep the processed images in the same folder as the unprocessed images, simply click the Save in Same Location button. Photoshop is smart enough — most of the time — to recognize the source folder and avoid reprocessing already processed images in an endless loop, but don’t risk it.
At the bottom of the Image Processor dialog box are also the options to run an Action on the images as they’re processed, to add your copyright information to the file’s metadata (not on the image itself), and to embed the color profile in the image.
Note also the Save and Load buttons. If you set up a couple of folders, one where you dump the originals and another where you save from Image Processor, you can save your usual setup and load it whenever you need to repeat the job.