Photoshop
Painting
Stroke Command
The Stroke command in the Edit menu is one of the ways you can apply a stroke or outline to a selection or a layer. The stroke applied with this command is painted and gives a softer look than the Stroke layer style which creates a sharp vector outline.
The image to the right consisted of three layers.
- The original lizard graphic on the upper left is on a layer surrounded by transparent pixels.
- The lizard layer was duplicated and a black stroke was applied to the lizard (lower right). A stroke can be applied to the edge of all pixels on a layer containing transparency, as demonstrated here.
- A stroke can also be applied to a completely opaque layer, which results in a border around the edge of the background layer, as was done here. The bottom layer contained a solid yellow fill and a green stroke was added.
To open the Stroke dialog, go to Edit > Stroke.
- Stroke Width
- The stroke can be set to any width you like.
- Stroke Colour
- Clicking on the colour swatch will open the colour picker. You can choose any colour for the stroke, although it must be a solid colour, not a gradient or pattern.
- Location
-
The image at the right demonstrates the difference between the different stroke Location settings. The top circle with no stroke was duplicated three times so each circle started out at the same size. Then a 10 px white stroke was added at 60% opacity.
- An inside stroke is created within the boundaries of the circle.
- A centre stroke is positioned so the inner half overlaps the circle and the outer half extends beyond it.
- An outside stroke surrounds the circle without overlapping it.
When applying a stroke to the outer edge of a solid background, remember to set the Location to Inside. With a centre or outside stroke, part or all of the stroke will fall outside the image boundaries and will be hidden.
- Blending
- The Blending options (Mode, Opacity, Preserve Transparency) work the same way as they do in the Fill dialog.
Applying a Stroke to a Selection
In addition, you can apply a stroke to a selection even if there are no pixels on the layer (right). A selection was made with the Elliptical Marquee tool on a transparent layer. Then a 10 px stroke with its Location set to Centre was applied. You can see the selection marquee centred inside the stroke.
Practice Exercise: Applying Strokes
In this exercise, you will create this graphic using just selections, fills and strokes. It will give you practice in applying strokes and in creating, transforming and filling selections.
- Open a new document, name it Stroke.psd and make it 300 x 300 with a transparent background.
- Pick two colours to use for this graphic and set them up as the foreground and background colours in the Toolbox. If one colour is lighter than the other, you'll get better results by setting the lighter colour as the foreground colour.
- Select the Elliptical Marquee tool and make sure the Anti-aliased option is turned on. Create an oval selection that is 180 x 50. You can either do this freehand by watching the Info panel as you're making the selection or you can set the Style option to Fixed Width, set the Width to 180 and the Height to 50, then click in the image.
- Once you've created the oval selection, use the arrow keys to nudge it until it's approximately centred.
- Press Alt-Backspace (Option-Delete) to fill the selection with the foreground colour.
- Go to Selection > Transform Selection. This will place a bounding box around the selection. Hold down the Shift key to constrain rotations to increments of 15o. Move the pointer outside of the bounding box until the pointer icon displays a curved arrow. Drag the bounding box in a counter-clockwise direction by 60o. You should feel it snap to every 15o increment so 60o will be four snaps. (Tip: if you lose track of the number of snaps, you can use the Undo command to restore the selection to its previous position. To start the transformation all over and remove the bounding box, use the Escape key.)
- Press Enter (Return) to apply the transformation and remove the bounding box.
- Fill the new selection with the foreground colour.
- Repeat steps 6-8 once more.
- Remove the selection by pressing Ctrl-D (Cmd-D).
- Select the Magic Wand tool and make sure Anti-aliased and Contiguous are enabled and Tolerance is set to 32. Click on the coloured pixels to select the entire area.
- Go to Selection > Transform Selection. Rotate the selection by 30o or two snaps.
- Press Enter (Return) to complete the transformation.
- Press Ctrl-Backspace (Cmd-Delete) to fill the selection with the background colour.
- Go to Edit > Stroke to open the Stroke dialog. Set the Width to 5 and select the Inside radio button. The foreground colour should already be displayed in the colour swatch. Click OK.
- Remove the selection by pressing Ctrl-D (Cmd-D).
- Open the Stroke dialog again. Click on the colour swatch to open the colour picker. Use the eyedropper to click on the background colour - either in your image or in the Toolbox. Click OK to close the colour picker. Set the stroke width to 10 px and choose the Outside radio button. Click OK. A stroke has been applied to the outer edge of the image.
- Use the Magic Wand to select the centre (background) colour.
- Go to Select > Modify > Contract. In the Contract Selection dialog, set the value to 10 and click OK.
- Open the Stroke dialog, set the Width to 10. You'll need to click on the colour swatch to open the colour picker. Use the eyedropper to sample the lighter colour in your image. (The colour is no longer displayed as the foreground colour in the Toolbox.) Click OK.
- Remove your selection and save the file.
Wide strokes and expanded or contracted selections have a tendency to develop straight corners on curved edges and rounded corners on straight edges. In this exercise, this effect is visible in a few areas. Using Inside strokes seems to eliminate this to some extent. Keeping the stroke width minimized will also help prevent distortion.
| Stroke Methods Compared | |
|---|---|
|
|
| Stroke command | Stroke layer style |
Vector strokes can be added to images using layer styles, as you'll learn in the next module. The image shown at the right, above, was made with them. Vector strokes are rendered more accurately but they can only be applied to an entire layer, not to a selection. Creating this graphic with layer styles involved quite a few more steps. On the other hand, layer styles can be modified at any point after their creation and the stroke can be a solid colour, gradient or pattern. Once a stroke is applied with the Stroke command, the pixels are blended with the underlying pixels. You'll have to weigh accuracy against how your image is constructed to decide which method will work the best in any given situation.
Stroke Command Summary
-
With the Stroke command, strokes can be added around:
- unselected pixels on a layer.
- selections, even if the layer is empty.
- a layer that is completely filled.
- Strokes are pixel-based and the paint will be blended with the underlying pixels.
- The stroke can be placed inside, in the centre, or outside of the object or selection border.
- Strokes can be any width. They cannot contain gradients or patterns.
Stroke Command Keyboard Shortcuts:
- Cancel transformation: Escape
Photoshop - TOC - Introduction - Books -
Painting - Links - Questions -
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - A - B - [ C ] -
