Chapters 14 and 8, respectively. Some line tool techniques discussed here apply to the line tool also when it's set to vector mode or work path mode.
Stroking a selection outline
Stroking is useful for creating frames and outlines. Generally, you can stroke an image in Photoshop in four ways:
The Stroke command: Select the portion of the image that you want to stroke and choose Edit Stroke to display the Stroke dialog box shown in Figure 6-26. Or, if you're working on a multilayered image, you can choose the Stroke command without making a selection; Photoshop then applies the stroke to the entire layer.

Figure 6-26: Use the options in the Stroke dialog box to specify the thickness of a stroke and its location with respect to the selection outline.
In the Stroke dialog box, enter the thickness of the stroke in the Width option box. The default unit of measurement here is pixels, but you can use inches and centimeters as well. Just type the value and then the unit abbreviation (px for pixels, in for inches, or cm for centimeters).You can set the stroke color from within the dialog box. Click the color swatch to select a color from the Color Picker — don't forget that you have full access to the eyedropper tool while the Color Picker is open. Press Enter or Return to close the Color Picker and return to the Stroke dialog box.
The Stroke dialog box also includes Mode, Opacity, and Preserve Transparency options that work like those in the Fill dialog box.
The Border command: Select a portion of the image and choose Select Modify Border to retain only the outline of the selection. Specify the size of the border by entering a value in pixels in the Width option box and press Enter or Return. To fill the border with the background color, press Ctrl+Backspace (z -Delete on the Mac). To fill the border with the foreground color, press Alt+Backspace (Option-Delete on the Mac). To apply a repeating pattern to the border, choose Edit Fill and select the Pattern option from the Use pop-up menu. You can even apply a command under the Filter menu or some other special effect.
Layer Style effects: If you want to stroke an entire layer, check out the options provided by the Layer Style feature. Choose Layer Layer Style Stroke to display the dialog box shown in Figure 6-27. At first glance, the options here appear to mirror those you find in the regular Stroke dialog box. They do, as long as you select Color from the Fill Type pop-up menu. But if you crack open that pop-up menu, you discover two goodies. First, you can fill the stroke with a gradient or a pattern. Second, you can adjust the pattern and gradient on-the-fly and preview the results in the dialog box. For example, you can scale the gradient and change its angle — two things you can't do in the regular Gradient Editor dialog box, I might add. By using the settings shown in the figure, I adapted a plain old black-to-white gradient to produce the shadowed frame effect you see in the preview.

Figure 6-27: With the Stroke options in the Layer Style dialog box, you can stroke a layer with a solid color, gradient, or pattern. You also can adjust the angle and scale of gradients, as I did to create the effect shown in the preview.
Cross-Reference | I cover the Layer Style dialog box in detail in Chapter 14, so if you have trouble figuring out the stroke options, look there for help. |
The Canvas Size trick: Okay, so this one is a throwaway, but I use it all the time. To create an outline around the entire image, choose Image Canvas Size, check the Relative check box, and enter twice the desired border thickness in pixels in the Width and Height options.For example, to create a 1-pixel border all the way around, enter 2 pixels for the Width value (1 for the left side and 1 for the right) and 2 pixels for the Height value (1 for the top and 1 for the bottom). (You could also deselect the Relative check box and add 2 pixels to the existing Width and Height values, if you're inordinately fond of doing math.) Leave the Anchor option set to the center tile. Choose Other from the Canvas Extension Color pop-up menu to bring up the Color Picker dialog box. Select a color for the stroke and click OK to return to the Canvas Size dialog box. When you press Enter or Return, Photoshop enlarges the canvas size according to your specifications and fills the new pixels around the perimeter of the image with the color you chose. Simplicity at its best.
Applying arrowheads to straight lines
The one function missing from all the operations in the preceding list is applying arrowheads. The fact is, in Photoshop, you can apply arrowheads only to straight lines drawn with the line tool.The line tool is grouped with the drawing tools. You can cycle between the tools by pressing U (or Shift+U, depending on your preferences setting for switching tools). As I mentioned previously, the line tool can create three different kinds of shapes. You can paint raster lines — that is, lines made up of pixels. Or you can draw vector-based lines on a new shape layer, as explained in Chapter 14. Finally, you can create a work path using the line tool, as I discuss in Chapter 8.You specify which type of line you want to create by clicking one of the three icons near the left end of the Options bar, which I labeled in Figure 6-28. If you don't see the Options bar on screen, press Enter or Return or double-click the line tool icon in the toolbox.

Figure 6-28: The arrowhead options appear in this drop-down palette.
Regardless of which type of line you're creating, you set the width of the line by entering a value into the Weight box in the Options bar. Then you add arrowheads using the drop-down options palette shown in the figure. To display the options, click the triangle at the end of the strip of shape icons (again, see the figure). Use the Arrowheads options as follows:
Start: Select this check box to add an arrowhead to the beginning of a line drawn with the line tool.
End: Select this check box to add an arrowhead to the end of a line. (Like you needed me to tell you this.)
Width: Enter the width of the arrowhead in this option box. The width is measured as a percentage of the line weight, so if the Weight is set to 6 pixels and the Width value is 500 percent, the width of the arrowhead will be 30 pixels. Math in action.
Length: Enter the length of the arrowhead, measured from the base of the arrowhead to its tip, again as a percentage of the line weight.
Concavity: You can specify the shape of the arrowhead by entering a value between negative and positive 50 percent in the Concavity option box. Figure 6-29 shows examples of a few Concavity settings applied to an arrowhead 50 pixels wide and 100 pixels long.

Figure 6-29: Examples of a 50100-pixel arrowhead subject to five different Concavity values.
Appending arrowheads to curved lines
Applying arrowheads to straight lines is a simple matter. Applying an arrowhead to a stroked selection outline is a little trickier but still possible. The following steps explain the process.
Note | For the effect shown in this example, you need raster arrowheads, so click the Fill Pixels icon in the Options bar (see Figure 6-28). Now your line tool creates raster lines rather than vector lines or work paths. |
STEPS: Adding an Arrowhead to a Free-Form Stroke
Create a new layer. Display the Layers palette by pressing the F7 key. Then click the little page icon at the bottom of the palette to create a new layer.
Draw and stroke a selection. Draw any selection outline you like. Stroke it by choosing Edit Stroke and applying whatever settings strike your fancy. Remember the value you enter in the Width option. In Figure 6-30, I drew a wiggly line with the lasso tool and applied a 4-pixel black stroke set to 30 percent Opacity.

Figure 6-30: Here I created a new layer, drew a free-form shape with the lasso tool, and stroked it with a 4-pixel black outline at 30-percent Opacity.
Press Ctrl+D (z -D on the Mac). This deselects all portions of the image.
Erase the portions of the stroke you don't need. Select the eraser tool by pressing E. Then drag to erase through the stroke layer without harming the layer below. Erase the areas of the stroke where you want to add arrowheads. I wanted to add an arrowhead behind the fly, so I erased around the fly.
Select the line tool and click the Fill Pixels icon in the Options bar.
Specify the line weight and arrowhead settings. Enter the line weight you used when stroking the selection outline into the Weight option box (in my case, 4 pixels). Next, display the line options drop-down palette. Just click the triangle at the end of the strip of shape icons, as shown previously in Figure 6-28. Select the End check box and deselect the Start check box. Then specify the width, length, and concavity of the arrowhead as desired.
Set the foreground color as needed. I applied a black stroke at 30 percent Opacity, so I set the foreground color to 30 percent gray. (Click the stroke with the eyedropper to change the foreground color to the stroke color.)
Zoom in to the point in the image where you want to add the arrowhead. You have to get in close enough to see what you're doing, as in Figure 6-31.

Figure 6-31: Use the line tool to draw a line no longer than the arrowhead. This appends the arrow to the end of the stroke. The view size of this image is magnified to 300 percent.
At the tip of the stroke, draw a very short line exactly the length of the arrowhead. Figure 6-31 illustrates what I mean. This may take some practice to accomplish. Start the line a few pixels in from the end of the stroke to make sure that the base of the arrowhead fits snugly. If you mess up the first time, choose Edit Undo or press Ctrl+Z (z -Z on the Mac) and try again.
That's all there is to it. From then on, you can continue to edit the stroke as you see fit. In Figure 6-32, for example, I erased a series of scratches across the stroke to create a dashed-line effect, all the rage for representing cartoon fly trails. I then set the eraser brush size to the largest, fuzziest setting and erased the end of the stroke (above the dog's head) to create a gradual trailing off. That crazy fly is now officially distracting our hero from his appointed rounds.

Figure 6-32: I finished by erasing dashes into the line and softening the end of the trail with a large, fuzzy eraser.