Seven days ago you learned about selections, and how selecting part of an image isolates that part so that you can work on it and not on the entire image. The problem with selections is that as soon as you remove the selection, it's lost forever. The only way to reselect something is to use the appropriate tools (Marquee, Lasso, and/or Magic Wand) and make the selection all over again.
Paths solve this dilemma. With paths (also called clipping paths), you can create and save specific selections for future use. The paths get saved right within the Photoshop file, sort of like a layer would be. What's more, those same paths can be used in other applications, such as Adobe Illustrator, Adobe PageMaker, and QuarkXPress. More details are coming later in this chapter. Finally, paths can also be useful when you want to create complex shapes by using the Pen tool.
Let's start by exploring the two different ways to create paths, and then go into techniques for editing and using them in Photoshop and beyond.
You've got two paths you can take for creating paths (sorry, I couldn't resist):
Depending on the image at hand, this can be the easiest and quickest way to create a path. You simply make a selection and convert it to a path.
Let's look at an example. Figure 9.1 shows our test image, an open book on a flat-color background. If you want to isolate the book from the background, you can do so by selecting the book.
Figure 9.1
Our test image. We want a clipping path that outlines the book.
As you remember from Day 2, "Selections: Editing and Manipulating Images," selecting can be accomplished by using a number of tools. For this image, the Magic Wand is perfect because the background pixels are roughly the same color. Simply set the Magic Wand tolerance to about 25 (so you're sure to get all the background pixels), select the background, and then Invert the selection (Select+Inverse) so now the book image is selected (see Figure 9.2).
Figure 9.2
The book is now selected.
Now that you have a selection, follow these steps to convert it to a path:
Figure 9.3
The pull-down menu of the Paths palette.
Figure 9.4
The Make Work Path dialog box.
Figure 9.5
When the path doesn't match the selection to your satisfaction, Tolerance is set
too high.
Figure 9.6
When Tolerance is set correctly, the path matches the selection satisfactorily.
Figure 9.7
Rename paths by using the Save Path dialog box.
TIP: Although renaming paths isn't required, it's a good idea, especially if your Photoshop document will eventually have multiple paths in it. If you don't rename a path and then create a second path, the second path will replace the first path in the Paths palette. Don't worry: both paths will still exist, and you can still recover the first path by selecting it and choosing Save Paths from the Paths palette pull-down menu. But if that seems like too much hassle and confusion to you, simply rename each path as you create it!
NOTE: Saying that you've created "a path" is a little misleading. Actually, the path that you see consists of a number of subpaths that Photoshop has created. But for our purposes, they act as a single path.
One thing to remember is that any path you create is not really part of the image. That is, you aren't changing the actual image at all. Think of it as adding a new layer to an image, like a layer of clear acetate that helps you manipulate an image better but doesn't necessarily alter it in any way.
There's also another way to create a path from a selection. Make a selection; then simply click on the Make Work Path button at the bottom of the Paths palette (see Figure 9.8). Photoshop creates the path automatically by using the existing Tolerance setting. Don't forget to rename the path using the Save Path dialog box!
Figure 9.8
Here I'm creating a new path around the central graphic on the book's left page.
Photoshop will use the same 1-pixel setting I used earlier.
Sometimes making a selection is too difficult or requires too much work on a particular image. In that case, consider using the Pen tool and drawing the path by hand.
If you've used vector-based illustration programs, such as Adobe Illustrator or Macromedia FreeHand, you already know about Bézier-based drawing tools like Photoshop's Pen tool. If you haven't used these kinds of tools before, you should know right up front that it takes a little practice, but the payoff is worth the effort.
NOTE: A Bézier curve is a curve defined by three points: one on the curve and two outside the curve at the ends of handles that you can use to change the angle and direction of the curve. If this sounds like gibberish, don't worry, you'll see some examples.
The best way to learn how to use the Pen tool is simply to play around with it in a new Photoshop document, so that's what we're going to do in this tutorial:
Figure 9.10
A simple click creates a corner point and a straight line.
Figure 9.11
A click-and-drag action creates a smooth point and a curved line.
Figure 9.12
Click and drag to create another smooth point on the same path.
Okay, that's the basics: straight lines via corner points and curved lines via smooth points. But there's more that you have to know about each one to use them effectively.
Corner points are easy. No matter what kind of line is coming into a corner point, the result is always an angle, not a curve. If a curved line comes into a corner point, it's the smooth point at the other end of that line that affects that line's angle at the corner point (see Figure 9.13).
Figure 9.13
Corner points surround a smooth point.
By the way, if you want to constrain corner points so they appear only at 45- or 90-degree angles, hold down the Shift key while you click to create the point.
As you saw in the first Pen tool example, the behavior of smooth points is a bit more complicated, and takes some getting used to. A smooth point will always try to create as smooth a curve as it can between two meeting lines (see Figure 9.14).
Figure 9.14
Smooth points do their utmost to create curves out of any situation.
There is a less smooth kind of curve you can create for special occasions. It's called a sharp curve, and here is how you create one:
Figure 9.15
Creating a sharp curve. The rightmost line is what I just created by using the Option
(or Alt) key.
Figure 9.16
The final sharp curve.
When you're creating all these points and lines, there's a preview feature that can be very helpful. Double-click on the Pen tool in the toolbar to bring up the Pen Tool Options palette. The only option here is called Rubber Band. Activating this feature enables you to preview both straight lines and curves before you click to create them. Experiment to see this feature at work.
To complete a path, you have two choices: "close" the path by connecting the final point to the initial point, or leave the path "open."
A closed path means you have created a "loop," so the final path has no beginning or end. To close a path, use the following steps:
Figure 9.17
Closing a path with a final corner point click.
An open path means the path has a beginning and an end. Figures 9.10 through 9.16
have all been open paths. To end a path that you want to keep open, use the following
steps:
Most of the time, the initial path you create, whether produced by converting a selection or drawing with the Pen tool, won't be perfect. It's often too difficult to get the selection just right or the lines and curves perfectly placed on the first try. You have probably already realized this while following the previous steps in this chapter.
Fortunately, you can easily alter paths after they are created. And, once again, you use the Pen tool (and its associated tools) to do this.
First, let's look at the various path tools available in Photoshop (see Figure 9.18):
Figure 9.18
Photoshop's path tools.
You can switch between these tools in one of two ways: either by clicking and holding down over the Pen tool in the toolbar, so the other path tools appear, or by pressing P on the keyboard, which will cycle through all the path tools one by one.
The best way to learn about these tools is through an example, so let's dive in. I'll use an example image with some irregular curves, so you're challenged to isolate the foreground (the head and shoulders) from the background (see Figure 9.19). (This Photoshop document appears on the CD-ROM; it's called head.psd.)
Figure 9.19
Our example image: let's draw and edit a path around this bizarre fellow's head,
shall we?
Figure 9.20
The initial path as created by the Pen tool and me.
NOTE: If you have a path but can't see any points, that simply means that the path isn't selected yet. Using the Direct Selection tool, click anywhere on the path line, and the points will appear.
Figure 9.21
Moving handles can correct the path in some places, but also adversely affects others.
Figure 9.22
After moving a few handles, the path is looking a bit better.
Figure 9.23
Moving points and handles usually solves most of the problems.
NOTE: Photoshop also enables you to move multiple points simultaneously. To select more than one point, hold down the Shift key as you click on points or drag a marquee around the points you want to select. Then you can move them all at once.
Figure 9.24
Sometimes adding a new point is the perfect solution.
But wait, there's more! Your toolbox for editing paths is not yet empty. You can also change existing points, delete line segments, add to a path, and more.
If you ever need to convert a point from one type to another, use the Convert Anchor Point tool. To convert a smooth point or a sharp curve to a corner point, just click on it. To convert a corner point or a sharp curve to a smooth point, click and drag. Finally, to convert a smooth point to a sharp curve, move just one of the point's handles.
If you ever have a path from which you want to delete just one segment, all you need to do is select the line or curve between the two points (using the Direct Selection tool) and then press Delete (Backspace on Windows). The line segment disappears.
If you ever want to delete an entire path, drag the path's name to the Trash Can icon in the Paths palette, just as you would throw away a layer.
Adding to an existing path is also easy. With the Pen tool selected, click on an endpoint of the path. Now you can continue the path as if you'd never stopped, adding points as desired.
You can even duplicate a path, either in parts or in its entirety. Use the Direct Selection tool to select the desired parts of the path, and then simply copy and paste. A clone is instantly created (see Figure 9.25).
Figure 9.25
Duplicating part of a path.
You've probably already figured these out on your own, but just in case, here are a few basic techniques for navigating among and using paths:
So what can you do with paths after you've gone to all the trouble of creating them? Well, a lot of things. In Photoshop, you can use paths to remember selections that you want to use repeatedly. You can also fill a path area or define the color, border, and so on of the outline of the path.
Further, you can use paths you create in Photoshop within other applications. Illustrator is particularly useful for dealing with paths, as you'll see later on. Finally, you can use paths as clipping paths in other programs, specifically page layout applications.
There are three primary uses for paths in Photoshop: as permanent selections, areas to be filled, or outlines to be stroked.
In Photoshop, paths are most useful as permanently saved selections. This can be incredibly helpful when you think you might want to reuse a specific selection later. When in doubt, create a path so that the selection will always be available!
You already learned how to convert a selection to a path. Here's how to convert a path into a selection:
Figure 9.26
The Make Selection dialog box.
There are also two shortcut methods for converting a path to a selection:
Figure 9.27
The button for converting a path to a selection.
Neither of these methods brings up the Make Selection dialog box, so Photoshop uses the previous Feather Radius setting.
Filling a path means just what you'd expect. Select a path, choose Fill Path from the pull-down palette menu, and you'll get the same kinds of options you get for filling a selection (see Figure 9.28). In the Fill Path dialog box, you can choose a color, a pattern, or a snapshot to fill the area with. You can also choose a blending mode, opacity percentage, optional transparency, anti-aliasing, and a feathering value (everything you already learned on previous days).
Figure 9.28
The options for filling a path.
Stroking a path means affecting the outline of the path, not the entire area enclosed within a path. Select a path and then choose Stroke Path from the pull-down palette menu. The dialog box enables you to choose the tool you want to use, from Pencil and Paintbrush to Blur and Sponge.
Whatever tool you pick, Photoshop uses that tool's current settings to create the result. So, for example, if you want to airbrush the path outline with only 60% pressure, make sure that value is set in the Airbrush Options palette before you select Stroke Path.
Figure 9.29
Mr. Weirdo with a stroked path via the Airbrush tool.
By the way, there are shortcuts for filling and for stroking. Hold your mouse pointer over the buttons at the bottom of the Paths palette, and you'll see the options.
Adobe Illustrator, if you recall, is a vector-based graphics program, which means that it's entirely based on points, lines, and curves. So it's a perfect environment for paths, and you can exchange paths between Photoshop and Illustrator.
Why would you want to use Photoshop paths in Illustrator? Primarily because each tool has its own strengths, and you want to capitalize on those strengths. If your paths need a lot of editing, you might consider bringing them into Illustrator because the latter program's path editing features are more robust and flexible. Then when you're done, you can take the paths back into Photoshop.
On the other hand, Photoshop produces more accurate results than Illustrator for defining a path initially. Illustrator's autotracing feature isn't always very accurate, but with Photoshop you can be as accurate as you want with selections and then convert the selections to paths. Thus, you might want to create paths in Photoshop that will be later used in Illustrator to create something like a logo or icon.
To export a path to Illustrator, follow these steps:
Figure 9.30
The dialog box for exporting paths to Illustrator.
I already mentioned one reason you might want to bring paths from Illustrator to Photoshop: Photoshop can be more accurate in defining paths. Any time you take an image from Illustrator to Photoshop, the paths you need to make Photoshop selections already exist in the Illustrator file.
Here's how to convert paths from Illustrator:
The final primary use for paths is for page layout programs, such as PageMaker and QuarkXPress. If an image you bring into PageMaker has a clipping path, you can silhouette that image in PageMaker--everything outside the clipping path will become transparent.
If you're going to use clipping paths in this way, it's recommended to use the EPS format for your image. TIFF also supports clipping paths, but not all applications support TIFFs with paths, so you're safer with EPS.
Here's how to do it:
TIP: It's often a good idea to simply leave the Flatness setting blank. This will instruct the application to let each printer use its own built-in flatness settings to decide on the value, which is often the best strategy.
Figure 9.31
The Clipping Path dialog box.
NOTE: Only printers that support at least PostScript Level 2 will print clipping paths.
Figure 9.32
The clipped head in PageMaker.
By the way, if you're using EPS files as recommended, you can skip steps 2 and 3
and activate the clipping path directly in the EPS Format dialog box that comes up
when you save a file as a Photoshop EPS file (see Figure 9.33). Just set the path
name and Flatness value here, click on OK, and you'll get the same result.
Figure 9.33
Defining a clipping path as you save as EPS.
The path is a magical Photoshop feature that has many applications in your daily Photoshop existence. You can use paths as permanent Photoshop selections that can be reused anytime, as methods to fill or stroke part of an image, as a way to convert areas of an image or work on an image in Illustrator, or as clipping paths to be exported into a page layout program. Photoshop provides an array of tools and options for creating paths: you can do so by converting a selection you have already made, or by drawing a path from scratch by using the Pen tool. You can also edit existing paths with the assorted path tools.
Paths--just another step on the path to Photoshop success!
© Copyright, Macmillan Computer Publishing. All rights reserved.