Chapter 13. Using Paths

<feature><title>What You’ll Learn in This Hour:</title> <objective>

Creating Paths

</objective>
<objective>

Editing Paths

</objective>
<objective>

Using Paths

</objective>
</feature>

Way back in Hour 3, “Making Selections,” you learned how to make selections that can isolate the part of the image so that you can work on it without affecting the rest of the image. Then in the last hour, you learned how to convert selections to masks to hide the parts of your image that you don’t want to show and to preserve selections so you can recall them later. The problem with selections is that it can be difficult to achieve a precise shape. Photoshop has all kinds of tools for creating selections based on the image content, by following object edges or choosing similarly colored areas, but what if you need to select a very smoothly curved area? Or a triangular area?

Paths offer you a way out of this dilemma. Using paths, you can create and save selections for future use, the same way you can save a mask to preserve a selection. Paths are saved right within the Photoshop file, along with layers, layer masks, channels, and all the rest. And because paths are vector based instead of pixel based, you aren’t restricted to the shapes you can create with the Selection tools. You can draw very precise shapes and smooth curves with the Path tools. Then you can use these shapes as the basis for selections, stroke and fill them as objects or lines in your picture, or turn them into vector masks.

Let’s start by exploring the different ways to create paths. Then we’ll look at techniques for editing and using them in Photoshop.

Creating Paths

You can create paths in three different ways (or you can use a combination of these methods):

  • Create a path based on a selection.

  • Create a path from scratch by using the Path tools to draw the path by hand.

  • Create a path using the Shape tools, which you learned about in Hour 7, “Drawing and Combining Shapes.”

Paths via Selections

Making a selection and converting it to a path is often the most efficient way to create a path. Let’s look at an example. Figure 13.1 shows the test image, a tire gauge. I’ll select the object and make what’s called a clipping path to clip it out of the background. Without Photoshop, you could achieve the same effect with a photographic print and a pair of scissors.

My goal is a clipping path that outlines the gauge.

Figure 13.1. My goal is a clipping path that outlines the gauge.

As you remember, you can create selections using several different tools. For this image, I selected the background with the Quick Selection tool and then cleaned up the selection using Quick Mask mode. Other objects might be selected more easily by using a combination of the Elliptical Marquee and the Polygonal Lasso. You might even need to use several Selection tools in turn to achieve the selection you need. Just keep the Shift key pressed as you apply each new tool, to merge the selections into one. Figure 13.2 shows my final selection.

The tire gauge is now selected.

Figure 13.2. The tire gauge is now selected.

 

Although renaming the work path isn’t required, it’s a good idea to make this a habit, especially if you might need the path again. If you leave the path labeled as a work path and then start a second path, one of two things will happen. First, if the work path is still active in the Paths panel, the new path will be added to it as a subpath. Second, if the original work path is not active in the Paths panel, it will disappear and the new path will replace it. You can choose Undo or use the History panel to go back and recover the original path, but it’s easier to simply rename it at the time of creation, turning it into a regular path that only you can delete.

Tip: Another Path to Travel

Photoshop offers a short-cut to create a path from a selection: Make a selection and then click the Make Work Path button at the bottom of the Paths panel. The path is created automatically using the same Tolerance setting you used for your last conversion.

Paths via the Path Tools

Sometimes making a selection is too difficult or requires too much work on a certain image, particularly if you want it to include smooth, complex curves. In that case, you can use the Path tools to draw the path by hand.

If you’ve used vector-based illustration programs, such as Adobe Illustrator, you’re already familiar with Bézier-based drawing tools such as Photoshop’s Path tools. If you haven’t used these kinds of tools, however, you should know that mastering them takes a little practice—but the payoff is well worth the effort. In addition to the standard tools that draw a straight or curved line and add or remove points on the line, Photoshop provides the Freeform Pen tool. This tool gives you the power to draw any kind of line you want—straight, curved, or squiggly—and turn it into a path. When used with the Magnetic option, the Freeform Pen tool makes drawing around a complicated object much easier.

Each end of a Bézier curve is 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 confusing, don’t worry; you’ll see some examples soon.

Okay, by now you should have the basic idea: You create straight lines via corner points and make curved lines using smooth points. But you have to know more about each kind of point to use it effectively.

Corner Points

Corner points are easy. No matter what kind of lines a corner point connects, the result is always an angle, not a curve. If a curved line ends in a corner point, the smooth point at the other end of the line controls the curve’s angle (see Figure 13.11), because corner points don’t have any handles that you can use for adjusting curves.

Corner points surround smooth points.

Figure 13.11. Corner points surround smooth points.

Tip: Restraining Order

If you want to constrain corner points so that each one appears only at a 45° or 90° angle from the last point you created, press the Shift key as you click to create the new point.

Smooth Points

As you saw in this hour’s first Try It Yourself exercise, the behavior of smooth points is a bit more complicated than that of corner points and takes some getting used to. A smooth point always creates a smooth curve between two lines (see Figure 13.12), and its direction handles are always directly opposite each other.

Smooth points do their utmost to create curves out of any situation.

Figure 13.12. Smooth points do their utmost to create curves out of any situation.

You can call upon one last kind of point when you need it; Adobe calls it a corner point with independent direction handles, but it’s also often called a combination point. It’s what you get when you put a corner point between two curves.

Previewing the Path

While you’re clicking and dragging to create all these points and lines, you might think that a preview feature would be very helpful. Fortunately, Photoshop provides one. Look at the Tool Options bar and locate the downward-pointing triangle at the right end of the strip of tool buttons. You’ll see an option called Rubber Band; click the check box to turn it on. 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; if you don’t like it after all, you can go right back to the same menu to turn it off again.

Completing the Path

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 is a loop with no beginning or end. To close a path, follow these steps:

  1. Use the Pen tool to draw a path, using whatever points you want.

  2. After you’ve clicked to place the last point, move your cursor right on top of your initial point. You’ll see a tiny circle appear next to the Pen cursor.

  3. Click to turn this final point into a corner point, or click and drag to create one last curve (see Figure 13.15).

    The starting and stopping point is the gray one.

    Figure 13.15. The starting and stopping point is the gray one.

An open path, on the other hand, has a beginning and an end. Figures 13.813.14 all show open paths. To finish off a path that you want to keep open, follow these steps:

  1. Use the Pen tool to draw a path, using whatever points you want.

  2. After you’ve clicked to place the last point, click the Pen tool button in the toolbar or the Options bar, or switch to any other tool. The path now ends at the last point you created.

    Note: Real, but Not Real

    One point to remember when you’re working with paths is that any path you create is not really part of the image, even though paths are saved in the file along with the image. ‘A path is not the same as a line drawn on the canvas; until you add color to it, it’s merely a theoretical line. When you stroke a path, it becomes a visible line. If you fill a path, it becomes a shape.

    The next time you click in the image window, you’ll start a new path instead of continuing your previous path. And if you didn’t save your previous path with a new name, the new path will replace it.

Editing Paths

Whether you create a path by converting a selection or by drawing with the Pen tool, it usually won’t be perfect. No matter how good you are with the Selection or Path tools, every path needs a little tweaking before it’s ready for prime time. You’ve probably realized this while working through the Try It Yourself exercises in this hour. Fortunately, you can easily alter paths after they are created. Again, you use the Pen tool (and the other Path tools) to do this kind of work.

The Path Tools

First, let’s take a look at the different Path tools Photoshop offers. Click and hold the Pen tool’s button in the toolbox (see Figure 13.16).

Photoshop’s Path tools, including both the Pen tools and the Path Selection tools.

Figure 13.16. Photoshop’s Path tools, including both the Pen tools and the Path Selection tools.

  • Pen tool—You’ve already met this tool; it’s used to create new paths.

    Tip: It’s Magnetic...

    Remember the Magnetic Lasso that automatically formed a selection marquee around the object you were trying to select? The Freeform Pen has a magnetic option, on the Tool Options bar, that works just the same way. You can use it to draw a path that traces the boundaries of a shape. To turn on this option, click the check box labeled Magnetic to the right of the tool buttons in the Tool Options bar.

  • Freeform Pen tool—As its name implies, you can use this tool to draw a freeform path in any shape. Photoshop adds points and handles as you go, so you can go back later and adjust any part of your path that’s not quite what you had in mind. This tool is best used with a graphics tablet, if you’ve got one.

  • Add Anchor Point tool—Use this tool to add new points to an existing path.

  • Delete Anchor Point tool—Use this tool to remove points from a path while leaving the path itself intact.

  • Convert Point tool—Use this tool to change a point’s type after you’ve created it. For example, you can turn a corner point into a smooth point, a smooth point into a combination point, and so on. You’ll learn more about how to use this tool in the next section.

Two Path Selection tools also help you work with paths: the Path Selection tool and the Direct Selection tool. They’re found in the toolbox just below the Type tools. The Direct Selection tool (represented by a hollow arrow) can select and move individual segments of a subpath. The Path Selection tool (the black arrow), on the other hand, always selects and moves all the components of a subpath at once. If you have several subpaths within the same path, the Path Selection tool will move one path at a time. To select all the subpath components of a path at once, Option-click (Mac) or Alt+click (Windows) its thumbnail in the Paths panel.

You can switch between the Pen tool and the Freeform Pen tool in one of two ways: either by clicking and holding down the Pen tool in the toolbar so that the menu of other Path tools appears, or by pressing Shift+P on the keyboard. Press A to switch to the Path tools, and press Shift+A to switch between the Direct Selection tool and the Path Selection tool. If you’re already using a Pen tool, press Command (Mac) or Control (Windows) to temporarily switch to the Direct Selection tool.

Basic Path Techniques

Here are a few basic techniques for navigating among and using paths:

  • To activate a path, simply click its name in the Paths panel, just as you would click a layer to activate it. Active paths show up in your image, as you would expect.

  • To deselect a path, click its name again or click in the empty area of the Paths panel. This makes the path disappear from the main window.

  • To delete a path, select the path’s entry in the Paths panel and drag it to the trash button at the bottom of the panel, just as you would to delete a layer.

  • To create a new path, you can do one of four things: Your first option is just to start drawing with one of the Path tools in the image window. This creates a new work path or, if an existing path is selected, adds to the existing path. If you want to name the path before you draw it, choose New Path from the Paths panel’s menu before you begin. You can also click the Create New Path button at the bottom of the panel to place a new path on the Paths panel. Finally, as you know, you can create a selection and then use the Make Work Path command or button to turn it into a path.

  • To duplicate a path, click its entry in the Paths panel and drag it to the Create New Path button. This works the same way as duplicating a layer.

Note: Use the Active Layer

When you fill or stroke a path, you are adding pixels to the active layer of your picture. Make sure that you’ve activated the layer you want to put the paint on before you apply the fill or stroke.

Using Paths

What can you do with paths after you’ve gone to all the trouble of creating them? Quite a lot, actually. Paths can represent selections that you want to use repeatedly. You can fill a path area or give it a stroke with your choice of color and width, and you even have a tool to apply the stroke. Stroking adds a stroke of paint on the current layer along the path, filling places inside the path with a color or pattern. Figure 13.17 shows a freeform path that has been stroked with red and filled with a pattern. Finally, you can use a path to hide whatever’s outside its bounds, either within Photoshop (a vector layer mask) or when the image is brought into another program, such as Adobe InDesign (a clipping path).

A filled and stroked path.

Figure 13.17. A filled and stroked path.

Turning Paths into Selections

In Photoshop, turning selections into paths is one way to make your selections more easily editable. This can be incredibly helpful when you want to tweak a selection edge or move part of it without moving the rest. When in doubt, create a path so that you can edit the selection one point at a time.

Filling a Path

Filling a path means just what you expect. Choose a path in the Paths panel and choose Fill Path from the panel menu; you’ll get the same options you see when you fill a selection, plus a couple of extras. In the Fill Path dialog (see Figure 13.20), you can choose a color, a pattern, or a snapshot to fill the area. You can also choose a blending mode and an opacity percentage, and you can opt to preserve any transparent pixels within the path, filling only pixels that are already painted. You can turn on anti-aliasing, and you can also set a feathering value. If the path consists of two or more subpaths, only the one you select with the Path Selection tool will be filled or stroked.

The Fill Path dialog has many options.

Figure 13.20. The Fill Path dialog has many options.

Stroking a Path

Stroking a path affects the outline of the path, not the entire area that it encloses. Select a path, and then choose Stroke Path from the Paths panel menu. The Stroke Path dialog offers you a choice of tools with which to apply the stroke, from Pencil and Brush to History Brush and Color Replacement tool (see Figure 13.21).

The Stroke Path dialog enables you to specify what kind of stroke you want to apply.

Figure 13.21. The Stroke Path dialog enables you to specify what kind of stroke you want to apply.

Whatever tool you pick, Photoshop uses that tool’s current settings to create the stroke. So, for example, if you want to airbrush the path outline with only 60% pressure, make sure that you switch to the Brush tool, turn on the Airbrush option, and set that Flow value in the Tool Options bar before you choose Stroke Path.

Tip: Take the Shortcut

If you hate using panel menus as much as I do, you’ll be happy to hear that the Paths panel contains buttons for both filling and stroking. Position your cursor over the buttons at the bottom of the Paths panel, and you’ll see the ToolTips identifying the buttons’ functions. Press Option (Mac) or Alt (Windows) as you click a button, to open its dialog instead of applying the fill or stroke immediately.

Using a Path to Clip an Image

In the last hour, you learned how to create vector layer masks from a path; now you have the skills you’ll need to draw that path in the first place. A layer mask, whether vector-based or pixel-based, hides parts of a layer while letting other parts show through. In the case of a vector mask, everything within the path’s bounds shows, and everything outside the path is hidden.

Vector masks work great in Photoshop, but they often don’t translate into other programs that don’t support Photoshop’s transparency. For example, if you look back at the pressure gauge image at the beginning of the hour (see Figure 13.1), you’ll see that its image window is square. I can use the path I created around the gauge to create a vector mask that will make everything around the gauge transparent, so that a background I place behind it will show around the edges. But if I save this image as a TIFF file and then import it into QuarkXPress, all those transparent pixels will be replaced with white ones.

To make sure that transparency is preserved when you’re using an image in another program, you need to do two things: Designate a clipping path and save your image in EPS format. To assign a clipping path to an image, make sure you’ve given the path a name, and then choose Clipping Path from the panel menu and pick the path you want to use. Then, when you save the image, choose Photoshop EPS for its format.

Note: You Do Have Options, But...

Some design programs support several methods of representing transparency. In addition to clipping paths, you can use alpha channels or layer masks, and, in this case, you’re not stuck with saving the image in EPS format. On the other hand, some older programs can use only EPS with clipping paths for transparency. So to be on the safe side, use the EPS-with-clipping-path method for saving nonrectangular images.

Summary

Paths are the key to true precision when creating selections, masks, and shapes in Photoshop. Because they’re based on mathematical equations, not pixel locations, they stay the same shape when you scale them up or down, and they’re infinitely adjustable. You can use paths to save selections for future use, turn them into complex filled and stroked shapes, and mask parts of your image with them. You can create paths from scratch with the Path tools or generate them by converting selections. Either way, editing those paths is a sometimes arcane art that requires you to get used to manipulating curves without actually touching them—but mastering it is a worthwhile pursuit because of the artistic freedom it gives you.

Q&A

Q.

What’s a Bézier curve, and why should I care?

A.

Bézier curves are a type of curve that can be described exactly by specifying the positions of the curve’s two endpoints and those endpoints’ four direction handles. They were first used in 1962 by a guy named, surprise, Pierre Bézier, a designer for the Renault car company. The nice thing about Bézier curves is that you don’t have to know the math behind them to use them, and if you master them, you’ll be well on your way to becoming an Illustrator expert as well as a Photoshop expert.

Q.

I’m not clear on the connection between paths and shapes. Can you explain?

A.

It’s simple: They’re the same thing. Think of shapes as fill layers with vector masks, and each vector mask is composed of a path. When you use a Shape tool to create a shape layer, you’re really just dropping in a prebuilt path as the vector mask for that layer. That brings us to a wonderful revelation: You can turn your own paths into custom shapes. Just choose a path in the Paths panel, and choose Edit, Define Custom Shape. Now you can drop that exact shape into any document you like, with whatever fill you desire. If the path wasn’t a closed path, Photoshop will close it to create the custom shape.

Q.

How do I know what tolerance to set when I convert a path to a selection?

A.

That depends on how smooth—or how accurate—you want the finished path to be. A tolerance of 1 pixel or less (.5 pixels is as low as the setting can go) makes the path follow the selection as precisely as possible. A tolerance of 5–10 produces a smoothed-out path, following your selection within 5 to 10 pixels rather than exactly.

Workshop

Quiz

1.

What does it mean to stroke a path?

  1. Using the points and direction handles to carefully massage its shape

  2. Adding a color to it to paint a line

  3. Painting over it with short strokes

2.

How do you turn a selection into a path?

  1. Make the selection and press Command-P (Mac) or Ctrl+P (Windows).

  2. Choose Make Work Path from the Paths panel menu.

  3. Line it with bricks.

3.

What does the Pen tool’s Rubber Band option do?

  1. Makes your paths visible as you click the mouse

  2. Makes paths spring back to a straight line when clicked

  3. Makes lines “stretchy” so that you can edit them without using the direction handles

Answers

1.

B. Think of stroking the length of the path with a paintbrush or any of the other Painting tools.

2.

B. Don’t try A unless you want to print your image.

3.

A. All paths are visible as you draw them (while you drag to set the handles), but Rubber Band mode makes the path visible as you move the mouse.

Exercise

Create a new image file and use the Pen tool to draw both a star-shaped path and a freeform path with a lot of curves. Stroke each of these paths with a color. Then use the Freeform Pen tool in Magnetic mode to trace around them. Notice that as long as you stay close to the original line, the Pen tool places a path right at the edge of the stroke. Fill the new shapes with a color. Draw two more paths inside these shapes, and fill them with a different color. Practice with the Path tools, adding points and refining your paths until you’re comfortable with them all.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset