Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples

Working with Layer Comps: Adobe Photoshop CS4 One-on-One

by Deke McClelland

This excerpt is from Adobe Photoshop CS4 One-on-One. How can you master the fundamentals of Photoshop CS4, with all of its incredible features? Deke McClelland's proven One-on-One learning system offers step-by-step tutorials, five hours of DVD-video demonstrations, and hands-on projects to improve your knowledge and hone your skills. Read about features such as Photoshop's new Adjustments panels in the book, and see how they're used first-hand in the video. The combination is uniquely effective.

buy button

As you increase the complexity of your layered documents, you'll find yourself experimenting with different compositional arrangements. What if you moved this layer over here? What if that layer were hidden? What if you gave the third layer a drop shadow? Sometimes the answer is obvious the moment you give it a try. Other times, the answer eludes you until several steps or even sessions later.

Photoshop's Layer Comps palette lets you save the current state of a document before you venture down an unclear road. As long as you don't delete or merge any of the layers in the saved layer comp, you can restore the saved state in its entirety later. Layer comp states are saved as part of the PSD file on disk, just like layers, channels, paths, and other specialized data.

To learn which layer attributes the Layer Comps palette can track, see the upcoming sidebar “What Layer Comps Can and Can't Save” (page 335). To learn how to use layer comps, immerse yourself in the following steps.

missing image file

Example file: The capture.psd

  1. Open a layered composition. Open the next episode of our gripping drama, The capture.psd, included in the Lesson 09 folder inside Lesson Files-PsCS4 1on1. (If you get a text warning, click the Update button.) As in the previous exercise, we see the Badlands photo and nothing more. But this time you won't have to build up the layers manually. I performed very nearly all the work ahead of time and saved my progress using layer comps.
  2. Open the Layer Comps palette. Choose WindowLayer Comps to display the Layer Comps palette. By default, it appears at the bottom of the column of icons to the left of the main palettes. You can leave it there if you like, with the palette hanging open like a flyout menu (see Figure 9-50), but in my humble opinion layer comps are too important to be given such short shrift. Which is why I recommend that you drag the icon or Layer Comps tab into the main docking pane on the right side of the screen. Figure 9-50 shows me dragging Layer Comps into the palette group that includes Layers, Channels, and Paths, but you can put it wherever you want.
    PhCS4 1on1 fig09-50.tif

    Figure 9-50.

  3. Click in front of a comp name to switch to it. Clicking in the column on the left side of the Layer Comps palette displays a tiny manuscript icon and shows the layers and effects saved with the corresponding comp. In Figure 9-51, I clicked in front of the third comp, Rapid City Photo. Notice that the photo is centered and fully visible. Click in front of Dinosaur Elements to see the photo offset and masked. This is the amazing power of layer comps.
    PhCS4 1on1 fig09-51.tif

    Figure 9-51.

  4. Examine a layer comp's settings. Any comp that has a triangle next to it includes a description. To view the description, click the ▶ to twirl open the comp, or double-click to the right of the comp name (not directly on the name) to display the Layer Comp Options dialog box shown in Figure 9-52. (If you prefer commands, click the icon in the top-left corner of the Layer Comps palette and choose Layer Comp Options.) The dialog box lets you view the complete description, as well as which layer attributes are saved with the comp. To learn more about the check boxes, read the sidebar “What Layer Comps Can and Can't Save” on the preceding page. When you're through poking around—we're not doing anything, we're just looking around—press the Esc key to exit the dialog box.
    PhCS4 1on1 fig09-52.tif

    Figure 9-52.

  5. Click the arrow buttons to cycle from one comp to the next. The small and buttons at the bottom of the Layer Comps palette let you switch to the previous and next saved state, respectively. I clicked the button a few times to advance to the final comp, Surveillance. Shown in Figure 9-53, this comp features a few layers that we haven't seen before, including the text layer that inspired the alert message in Step 1 (page 333). If the comp is to be believed, it would seem my movements are being monitored.
    PhCS4 1on1 fig09-53.tif

    Figure 9-53.

  6. Go to the Layers palette. If you're ever curious to see how a comp was created, just refer to the Layers palette. There you'll find several layers and sets not included in the previous exercise, some of which are turned on to create the green-TV-artifact effect, some of which are not. Feel free to explore the layers as you see fit. With layers, you need fear nothing. Anything you turn on now you can turn off later.
  7. Delete the Plans Identified layer. Click the layer called Plans Identified. This is an editable (not hand-drawn or otherwise rendered out to pixels) text layer that identifies the target around the rolled-up paper so deftly hidden in Bronco the dinosaur's mitten, as seen in Figure 9-54 below. The idea behind the message is fine, but I ultimately decided that it ruins the subtlety of the piece. (Yes, the piece has subtlety—loads of it.) To delete the layer, click the trash can icon at the bottom of the Layers palette. Then click Yes to confirm the deletion, as in the figure.
    PhCS4 1on1 fig09-54.tif

    Figure 9-54.

To bypass the confirmation and delete the layer without any grousing from Photoshop, you can Alt-click (or Option-click) the trash can. But that's the old school sucker's route. Here's the better way.

With the layer selected, just press the Backspace or Delete key. The layer goes away, with no warning whatsoever. New to Photoshop CS4, this technique works regardless of what tool is active.

Pearl of Pearl Graphic Wisdom

Deleting the Plans Identified layer upsets two layer comps, Surveillance and Rough Comp, which are now marked with yellow warning icons in the Layer Comps palette. Although only one of those particular comps actually displayed the layer, both comps were created or updated since the Plans Identified layer was introduced. Therefore, they both knew of the layer's existence; the other comps did not. To get rid of the icons, you must update the two Plans Identified–aware comps as explained below.

  1. Update the affected layer comps. You update the two comps in slightly different ways:
  1. Restore the Surveillance comp. Now we'll create our own comp by basing it on the last comp, Surveillance. Click in front of the comp name to restore its layer settings.
  2. Turn on the three hidden layer items. Go to the Layers palette and turn on the hidden group Emperor Scratch as well as the top two layers, Text and Backcard. (The quickest way to display all three s is to click in the left column in front of Emperor Scratch and drag up.) The result is the malevolent duckbill skeleton from Lesson 7—augmented with a spiffy row of suspiciously unduckbillish carnivore teeth—along with a fiendish new caption, all of which appear in Figure 9-56 on the facing page. Sounds like he's talking about me, but he's really after Bronco. Bad blood, you know. They're stepbrothers or something, I forget.
    PhCS4 1on1 fig09-56.tif

    Figure 9-56.

  3. Create a new layer comp. Click the icon at the bottom of the Layer Comps palette to display the New Layer Comp dialog box. Name the comp “The Menacing Observer” and turn on all three check boxes. If you want to annotate the comp, enter a comment like the one shown in Figure 9-57. Click the OK button to add the new state to the Layer Comps palette.
    PhCS4 1on1 fig09-57.tif

    Figure 9-57.

  4. Cycle through the comps as desired. In Figure 9-58 we see details from three of the eight comps. Given that these are views of a single file, and that every one of them relies on the very same collection of 27 layers and five groups, it's amazing just how unique each comp is.
    PhCS4 1on1 fig09-58.tif

    Figure 9-58. Badlands photo, Rough comp, The menacing observer

  5. Save your changes. Because we deleted a layer (Step 7, page 337), I recommend that you choose FileSave As. Give the image a new name but keep it in the Photoshop (PSD) format. Photoshop saves all layers and comps with the file. The comp that was active when you saved the file will be in effect the next time you open it.

The results of your toils are eight independent pieces of artwork saved inside one layered composition. This file consumes much less room on disk than it would if each comp was saved as a separate PSD file. And as an added convenience, you can edit the various comps together inside a single file.

If you enjoyed this excerpt, buy a copy of Adobe Photoshop CS4 One-on-One

Copyright © 2009 O'Reilly Media, Inc.