When Things Go Worng
It's 11 PM on the night before your big presentation. You've been working on this image for thirteen hours, and you're beginning to experience a bad case of "pixel vision." After making a selection, you run a filter, look carefully, and decide that you don't like the effect. But before you can reach Undo, you accidentally click on the document window, deselect-ing the area.
That's not so bad, is it? Not until you realize that undoing will only undo the deselection, not the filter... and that you haven't saved for half an hour. The mistake remains, and there's no way to get rid of it without losing the last 30 minutes of brain-draining work. Or is there? In this section of the chapter, we take a look at the various ways you can save yourself when something goes terribly wrong.
Undo. The first defense against any offensive mistake is, of course, Undo. You can find this on the Edit menu, but we suggest keeping one hand conveniently on the Command and Z keys, ready and waiting for the blunder that is sure to come sooner or later. Note that Photoshop is smart enough not to consider some things "undoable." Taking a snapshot, for instance, doesn't count; so you can take a snapshot and then undo whatever you did just before the snapshot. Similarly, you can open the Histogram, hide edges, change foreground or background colors, zoom, scroll, or even duplicate the file, and Photoshop still lets you go back and undo the previous action.
Revert to Saved. You'd think this command is pretty easy to interpret. If you've really messed up something in your image, the best option is often simply to revert the entire file to the last saved version by selecting Revert from the File menu. In most applications, it's the same as closing the file without saving changes, then reopening it, but in Photoshop, Revert doesn't go back to the file that's saved on disk unless you actually selected Save from within Photoshop after opening the file. If you open an image in Photoshop, do a bunch of stuff, then choose Revert, what you get is the file as it first appeared in Photoshop. What's the difference?
The big difference is that anything you do using the Missing Profile or Profile Mismatch warnings doesn't get undone when you revert. For example, when you open an Untagged image, and use the Missing Profile warning to assign the Adobe RGB profile, if later you choose Revert you'll get an Adobe RGB image, not an Untagged one. What's worse is that when you make a conversion using the Profile Mismatch warningactually changing the numbers in the filechoosing Revert will give you the image after the conversion, not the image that was saved on disk.
Worse still, when all you've done to the image is to change its profile or make a color conversion using the Profile Mismatch warning, the Revert command is dimmed and unavailable. We think this is a bug, and we hope it gets squashed, but keep an eye out for itit's quite obscure. If you run into this situation, the only way to get back to the original image is to close it without saving, then re-open it (which is what we think Revert should do under all circumstances). If you do choose Revert, any changes you've made since the file was opened are lost, however, so proceed with caution. Note that the Revert feature is undoable.
The History Palette
There is a school of thought that dictates, "Don't give people what they want, give them what they need." The Photoshop engineering team appears to advocate thisthey spend hours listening to and thinking about what people ask for, then they come back with a feature that goes far beyond what anyone had even thought to request. For example, people long asked Adobe for multiple Undos (the ability to sequentially undo steps that you've taken while editing a Photoshop image). The result is the History palette, which goes far beyond a simple Undo mechanism into a whole new paradigm of working in Photoshop.
The History palette, at its most basic, remembers what you've done to your file and lets you either retrace your steps or revert back to any earlier version of the image. Every time you do something to your imagepaint a brush stroke, run a filter, make a selection, and so onPhotoshop saves this change as a state in the History palette (see Figure 2-32). At any time, you can revert the entire image to any previous state, orusing the History Brush tool or the Fill command, which we'll discuss in a momentselectively paint back in time.
Figure 2-32 The History palette
There is, however, an itty-bitty problem with the History palette: it can take up a lot of RAM. Sorry, did we say "a lot"? We meant "vast, awe-inspiring, mind-boggling quantities" of memory, particularly since Photoshop 6's 100-state limit has been increased to 1000 in Photoshop 7. As we pointed out in Chapter 1, Building a Photoshop System, Photoshop can require as much as 10 to 20 times your file size in RAMor moreto perform efficiently when it is saving history states (that's 200 to 400 MB of RAM for a 20 MB image). Performing simple tasks such as opening, rotating, sharpening, and saving may take significantly longer when the History feature is turned on.
Turning Off History. If you're doing straight-laced production work all day (the kind of work for which a single Undo is perfectly adequate), you may want to avoid the History feature's heavy RAM overhead by changing the History States value to 1 in the Preferences dialog box (press Command-K). Similarly, you can turn off "Automatically Create First Snapshot" in the History Options dialog box (which you can find on the History palette's popout menu). You might also want to turn off these functions if you're going to batch-process a number of images using actions or the Automate "wizards" (because in these cases, History isn't necessary).
The History palette has two sections: snapshots and states. Let's take a look at each of these and how you can use them.
Snapshots. Early versions of Photoshop let you save a single snapshot of your document, representing a moment in time for your image. The History palette lets you save any number of snapshots so that at any time you can go back to a specific state. There are two main differences between snapshots and states.
Photoshop records almost everything you do to an image as a state. By default, snapshots are only recorded when you first open an image and when you click the New Snapshot button in the History palette.
When the number of states recorded on the History palette exceeds the Maximum Remembered States value (set in the History Options dialog box), the oldest states start dropping off the list. Snapshots don't disappear until you close the document.
What's in the Snapshot. When you click the New Snapshot button on the History palette (or select New Snapshot from the palette's popout menu), Photoshop saves the whole document (individual layers and all). Depending on how many layers you have and how large your document is, this might require a lot of RAM. If you Option-click the button, Photoshop offers two other less-memory-intensive snapshot choices: a version of the image with merged layers, or just of the currently selected layer. (If you find yourself Option-clicking the button a lot in order to get these options, then turn on the Show New Snapshot Dialog By Default checkbox in History Options. That way, you don't have to press the Option key anymore.)
Stepping through states. As we mentioned above, Photoshop saves every brush stroke, every selection, every anything you do to your image as a state on the History palette (though the state only remains on the palette until you reach the maximum number of states or you close the document). There are three ways to move among states of your image.
To revert your image back to a state, you can click on any state's tile in the History palette.
You can move the active state marker to a state on the History palette.
You can press Command-Z to step back to the last state (just as you've always been able to do). But you can also press Command-Option-Z to move backward one state at a time, and Command-Shift-Z to move forward one state at a time.
In general, when you move to an earlier state, Photoshop grays out every subsequent state on the History palette, indicating that if you do anything now these grayed-out states will be erased. This is like going back to a fork in the road and choosing the opposite path from what you took before. Photoshop offers another option: if you turn on the Allow Non-Linear History checkbox in the History Options dialog box, Photoshop doesn't gray out or remove subsequent states when you move back in time (though it still deletes old states when you hit the maximum number of states limit).
Non-Linear History is like returning to the fork in the road, taking the opposite path, but then having the option to return to any state from the first path. For example, you could run a Gaussian Blur on your image using three different amountsreturning the image to the pre-blurred state in the History palette each timeand then switch among these three states to decide which one you wanted to use.
The primary problem with Non-Linear History is that it may confuse you more than help you, especially when you're dealing with a number of different "forks in the road."
The History Brush. Returning to a previous state returns the entire image to that state. But Photoshop's History feature lets you selectively return portions of your image to a previous state, too, with the History Brush and the Fill command. Before painting with the History Brush, first select the source state in the History palette (click in the column to the left of the state from which you want to paint). For instance, let's say you sharpen a picture of a face with Unsharp Masking (see Chapter 9, Sharpening) and find that the lips have become oversharp. You can select the History Brush, set the source state to the presharpened state, and brush around the lips (though you'd probably want to reduce the opacity of the History Brush to 20 or 30 percent by pressing 2 or 3 first).
The History Brush tool (press Y) is very similar to the Eraser tool when the Erase to History checkbox is turned on in the Options bar, but the History Brush lets you paint with modes, such as Multiply and Screen.
Snap Before Action. If you run an action in the Actions palette that has more steps than your History States preference, you won't be able to "undo" the action. That's why before running the action you should either save a snapshot of your full document or set the source state for the History Brush to the current state. The latter works because Photoshop never "rolls off" the source state in the History palette, so you don't have to worry about its getting deleted after reaching the maximum number of states.
Fill with History. One last nifty technique that can rescue you from a catastrophic "oops" is the Fill command on the Edit menu (press Shift-Delete). This lets you fill any selection (or the entire image, if nothing is selected) with the pixels from the current source state on the History palette. We usually use this in preference to the History Brush or Eraser tools when the area to be reverted is easily selectable. Sometimes when we paint with those tools, we overlook some pixels (it's hard to use a brush to paint every pixel in an area at 100 percent). This is never a problem when you use the Fill command. However, Fill isn't available on high-bit images.
You've always been able to press Option-Delete to fill a selection or layer with the foreground color. In version 4, Photoshop added the ability to automatically preserve transparency on the layer when you add the Shift key (slightly faster than having to turn on the Preserve Transparency checkbox in the Layers palette). Similarly, you can fill with the background color by pressing Command-Delete (add the Shift key to preserve transparency). To fill the layer or selection with the current history source state, press Command-Option-Delete. And, of course, you can add the Shift key to this to fill with Preserve Transparency turned on.
Persistent States. Remember that both snapshots and states are cleared out when you close a document. If you want to save a particular state or snapshot, drag its tile over the Create New Document button on the History palette. Now that state is its own document that you can save to disk. If you want to copy pixels from that document into another image, simply use the Clone Stamp tool (you can set the source point to one document and then paint with it in the other file).
Revert When Revert Doesn't Work. Deke McClelland taught us a trick at a recent Photoshop conference that has already saved David's buttocks several times. Because David has a tendency to type fast and loose, he'll often press Command-S (Save) when he really meant to press Command-A (Select All) or Command-D (Deselect). Of course, this saves over his file on disk, often ruining his original scan. The History palette to the rescue! Remember that the default preference for the History palette is to create a snapshot of the image when you first open it. If you save over your original image, you can drag the snapshot's tile over the Create New Document button in the History palette to recreate the original data in its own file.
Copying States. Although Photoshop lets you copy states from one document to another simply by dragging them from the History palette onto the other document's window, we can't think of many good reasons to do this. The copied state completely replaces the image that you've dragged it over.
When History Stops Working. Note that you cannot use the History Brush or the Fill from History feature when your image's pixel dimensions or color mode has changed. Pixel dimensions usually change when you rotate the whole image, use the Cropping tool, or use the Image Size or Canvas Size dialog boxes.
Purging States. As we said earlier, the History palette takes up a lot of memory. If you find yourself needing more RAM, you might try clearing out the History states by either selecting Clear History from the popout menu on the History palette or choosing History from the Purge submenu (under the Edit menu). The former can be undone in a pinch; the latter cannot. Curiously, neither of these removes your snapshots, so you have to delete those manually if you want to save even more RAM. Remember that closing your document and reopening it will also remove all snapshots and history states.