Selecting by Shape

Selections based on shape are probably the easiest ones to make. Whether the object you want to grab is rectangular, elliptical, or rectangular with rounded corners, Photoshop has just the tool for you. You’ll use the first couple of tools described in this section often, so think of them as your bread and butter when it comes to making selections.

The Rectangular and Elliptical Marquee Tools

Photoshop’s most basic selection tools are the Rectangular and Elliptical Marquees. Any time you need to make a selection that’s squarish or roundish, reach for these little helpers, which live at the top of the Tools panel, as shown in Figure 4-2.

You’ll spend loads of time making selections with the Rectangular and Elliptical Marquee tools. To summon this menu, click and hold down your mouse button for a couple of seconds.

Figure 4-2. You’ll spend loads of time making selections with the Rectangular and Elliptical Marquee tools. To summon this menu, click and hold down your mouse button for a couple of seconds.

To make a selection with either marquee tool, just grab the tool by clicking its icon in the Tools panel or by pressing M, and then mouse over to your document. When your cursor turns into a tiny + sign, drag across the area you want to select (you’ll see the marching ants as soon as you start dragging). Photoshop starts the selection where you clicked and continues it in the direction you drag as long as you hold down the mouse button. When you’ve got marching ants around the area you want to select, release the mouse button.

You can use a variety of tools and techniques to modify your selection, most of which are controlled by the Options bar (Figure 4-3). For example, you can:

  • Move the selection. With a selection tool active, click anywhere within the selected area, and then drag to another part of your image. (If you were to drag with the Move tool instead, you’d move the pixels inside the selection rather than the selection itself.)

    Tip

    When you start drawing a selection, Photoshop activates the Options bar’s “New selection” icon (see Figure 4-3). In this mode, you can move a selection as you’re drawing it by moving your mouse while pressing the mouse button and the space bar. When you’ve got the selection where you want it, release the space bar—but not your mouse button—and continue drawing the selection.

  • Add to the selection. When you click the Options bar’s “Add to selection” icon (labeled in Figure 4-3) or press and hold the Shift key, Photoshop puts a tiny + sign beneath the cursor to let you know that whatever you drag across next will get added to the current selection. This mode is handy when you need to select areas that don’t touch each other, like the doors in Figure 4-3, or if you’ve selected most of what you want but notice that you missed a spot. Instead of starting over, simply switch to this mode and draw around that area as if you were creating a new selection.

  • Subtract from the selection. Clicking the “Subtract from selection” icon (also labeled in Figure 4-3) or pressing and holding the Option key (Alt on a PC) has the opposite effect. A tiny – sign appears beneath your cursor to let you know you’re in this mode. Mouse over to your document and draw a box (or oval) around the area you want to deselect.

  • Intersect one selection with another. If you click the Options bar’s “Intersect with selection” icon after you make a selection, Photoshop lets you draw another selection that overlaps the first; the marching ants then surround only the area where the two selections overlap. (It’s a little confusing, but don’t worry—you’ll rarely use this mode.)The keyboard shortcut is Shift-Option (Shift+Alt on a PC). Photoshop puts a tiny multiplication sign (x) beneath your cursor when you’re in this mode.

  • Feather the selection. To soften the edges of your selection so that it blends into the background or another image, use feathering. You can enter a value (in pixels) in the Options bar’s Feather field before you create the selection, as this setting applies to the next selection you make. As you’ll learn later in this chapter, feathering a selection lets you gently fade one image into another image or into a color. See the box on The Softer Side of Selections for the full scoop on feathering, including how to feather a selection after you create it.

    Using these Options bar icons (or better yet, the keyboard shortcuts mentioned in this section), you can add to or subtract from a selection, as well as create a selection from two intersecting areas.All selections begin at the point where you first click, so you can easily select one of these doors by dragging diagonally from its top-left corner to its bottom right. You can tell from the tiny + sign next to the crosshair-shaped cursor that you’re in “Add to selection” mode, so this figure now has two selections: the blue door and the red door.As you drag to create a selection, you also get a helpful overlay that displays width and height info. If you move a selection, you instead see X and Y axis info that indicates how far you’ve moved the selection.Give this selection technique a spin by downloading the practice file Doors.jpg from this book’s Missing CD page at www.missingmanuals.com/cds.

    Figure 4-3. Using these Options bar icons (or better yet, the keyboard shortcuts mentioned in this section), you can add to or subtract from a selection, as well as create a selection from two intersecting areas. All selections begin at the point where you first click, so you can easily select one of these doors by dragging diagonally from its top-left corner to its bottom right. You can tell from the tiny + sign next to the crosshair-shaped cursor that you’re in “Add to selection” mode, so this figure now has two selections: the blue door and the red door. As you drag to create a selection, you also get a helpful overlay that displays width and height info. If you move a selection, you instead see X and Y axis info that indicates how far you’ve moved the selection. Give this selection technique a spin by downloading the practice file Doors.jpg from this book’s Missing CD page at www.missingmanuals.com/cds.

  • Apply anti-aliasing. Turn on the Options bar’s Anti-alias setting to make Photoshop smooth the color transition between the pixels around the edges of your selection and the pixels in the background. Like feathering, anti-aliasing softens the selection’s edges slightly so that they blend better, though with anti-aliasing you can’t control the amount of softening Photoshop applies. It’s a good idea to leave this checkbox turned on unless you want your selection to have super crisp—and possibly jagged and blocky—edges.

  • Constrain the selection. To constrain your selection to a fixed size or aspect ratio (so that the relationship between its width and height stays the same), pick Fixed Size or Fixed Ratio from the Options bar’s Style menu, and then enter the size you want in the resulting Width and Height fields. (If you choose Fixed Size, be sure to enter a unit of measurement into each field, too, such as px for pixels.) If you leave the Normal option selected, you can draw any size selection you want.

Here’s how to select two objects in the same photo, as shown in Figure 4-3:

  1. Click the marquee tool icon in the Tools panel, and then choose the Rectangular Marquee from the menu shown in Figure 4-2.

    Photoshop remembers which marquee tool you last used, so you’ll see that tool’s icon in the Tools panel. If that’s the one you want to use, just press M to activate it. If not, in the Tools panel, click and hold whichever marquee tool icon is showing until the menu appears, and then choose the tool you want.

    Tip

    To cycle between the Rectangular and Elliptical Marquee tools, press M to activate the marquee toolset and then press Shift-M to activate each one in turn. If that doesn’t work, make sure a gremlin hasn’t turned off the preference that makes this trick possible: Choose Photoshop→Preferences→General (Edit→Preferences→General on a PC) and confirm that “Use Shift Key for Tool Switch” is turned on.

  2. Drag to draw a box around the first object.

    For example, to select the blue door shown in Figure 4-3, click its top-left corner and drag diagonally toward its bottom-right corner. When you get the whole door in your selection, release the mouse button. Don’t worry if you don’t get the selection in exactly the right spot; you can move it around in the next step.

  3. If necessary, move your selection into place.

    To move the selection, click inside the selected area (your cursor turns into a tiny arrow), and then drag the selection box where you want it. You can also use the arrow keys on your keyboard to nudge the selection in one direction or another (you don’t need to click it first).

  4. In the Options bar, click the “Add to selection” icon, and then select the second object by drawing a selection around it.

    Photoshop lets you know that you’re in “Add to selection” mode by placing a tiny + sign below the cursor. Once you see it, mouse over to the second door and drag diagonally from its top-left corner to its bottom right, as shown in Figure 4-3. (Alternatively, you can press and hold the Shift key to put the tool into “Add to selection” mode.)

    If you need to move this second selection around, do that before you release the mouse button or you’ll end up moving both selections instead of just one. To move the selection while you’re drawing it, hold down your mouse button, press and hold the space bar, and then drag to move the selection. When it’s in the right place, release the space bar—but keep holding the mouse button—and then continue dragging to draw the selection. This maneuver feels a bit awkward at first, but you’ll get used to it with practice.

You’ve just made your first selection and added to it. Way to go!

Tip

To draw a perfectly square or circular selection, press the Shift key as you drag with the Rectangular or Elliptical Marquee tool, respectively. To draw the selection from its center outward (instead of from corner to corner), press and hold the Option key (Alt on a PC) instead. And to draw a perfectly square or circular selection from the center outward, press and hold Shift-Option (Shift+Alt) as you drag with either tool. Just be sure to use these tricks only on new selections—if you’ve already got a selection, pressing the Shift key pops you into “Add to selection” mode.

Creating a Soft Vignette

The Elliptical Marquee tool works just like the Rectangular Marquee tool except that it draws round or oval selections. It’s a great tool for selecting things that are, well, round, and you can use it to create the ever-popular, oh-so-romantic, soft oval vignette collage shown in Figure 4-4. Here’s how:

  1. Open two images and combine them into the same document.

    Simply drag one image from its Layers panel into the other document’s window, as shown on Exporting Layers to Separate Files.

  2. In the Layers panel, reposition the layers so the soon-to-be-vignetted photo is at the top of the layer stack.

    Make sure that both layers are unlocked so you can change their stacking order. If you see a tiny padlock to the right of a background layer’s name, single-click it to unlock it (in previous versions of Photoshop, you had to double-click the padlock). Then drag the layer containing the photo you want to vignette (in Figure 4-4, that’s the armadillo pic) to the top of the Layers panel.

    By creating a selection with the Elliptical Marquee tool, adding a layer mask (page 120), and then feathering the mask, you can create a quick two-photo collage like this one. Wedding photographers and moms—not to mention armadillo fans—love this kind of thing!By using the Properties panel to apply the feather, you gain the ability to change or even remove the feather later on (provided you save the document as a PSD file).Once you get the hang of this technique, try creating it using the Ellipse tool (one of Photoshop’s vector shape tools) set to draw in Path mode, as described on page 568.

    Figure 4-4. By creating a selection with the Elliptical Marquee tool, adding a layer mask (page 120), and then feathering the mask, you can create a quick two-photo collage like this one. Wedding photographers and moms—not to mention armadillo fans—love this kind of thing! By using the Properties panel to apply the feather, you gain the ability to change or even remove the feather later on (provided you save the document as a PSD file). Once you get the hang of this technique, try creating it using the Ellipse tool (one of Photoshop’s vector shape tools) set to draw in Path mode, as described on page 568.

  3. Grab the Elliptical Marquee tool and select the part of the image you want to vignette (here, the armadillo’s head and, um, shoulders).

    Peek at your Layers panel to make sure the correct image layer is active (the armadillo), and then—in the main document window—position your cursor near the center of the image. Press and hold the Option key (Alt on a PC), and then drag to draw an oval-shaped selection from the inside out. When you’ve got the selection big enough, release the Option (Alt) key and your mouse button.

  4. Hide the area outside the selection with a layer mask.

    You could simply inverse the selection (Meet the Marching Ants) and then delete the area outside it, but that’d be mighty reckless. What if you changed your mind? You’d have to undo several steps or start over completely! A less destructive and more flexible approach, which you learned about back on Layer Blending, is to hide the area outside the selection with a layer mask. To do that, over in the Layers panel, make sure the correct layer is active (the armadillo), and then add a layer mask by clicking the circle-within-a-square icon at the bottom of the panel. Photoshop hides everything outside the selection, letting you see through to the bluebonnet layer below. Beautiful!

  5. Use the Properties panel’s Feather slider to feather the selection’s edges.

    With the layer mask active, open the Properties panel by choosing Window→Properties or double-clicking the mask thumbnail itself. In the panel that appears, drag the Feather slider to the right and Photoshop softens the selection in the document as you watch. (Alternatively, type a number or decimal value in the text box above the Feather slider.)

  6. Choose FileSave As, and then pick Photoshop as the format.

    Doing so lets you tweak the Feather amount later on by activating the layer mask and then reopening the Properties panel.

That armadillo looks right at home, doesn’t he? You’ll want to memorize these steps because this method is perhaps the easiest—and most romantic—way to combine two images into a new and unique piece of art. (You’ll learn how to use the vector shape tools to do the same thing on Masking with Paths.)

The Single Row and Column Marquee Tools

The Marquee toolset also contains the Single Row Marquee and Single Column Marquee tools, which can select exactly one row or one column’s worth of pixels, spanning either the width or the height of your document. You don’t need to drag to create a selection with these tools; just click once in your document and the marching ants appear.

You may be wondering, “When would I want to do that?” Not often, it’s true, but consider these circumstances:

  • Mocking up a web page design. If you need to simulate a column or row of space between certain areas in a web page, you can use either tool to create a selection and then fill it with the website’s background color.

  • Create a repeating background on a web page. If you’re creating an image that you’ll use as a repeating background, select a horizontal row and then instruct your HTML-editing program to repeat or stretch the image as far as you need it. This trick can make the page load a lot faster.

  • Stretching an image to fill a space. If you’re designing a web page, for example, you can use these tools to extend an image by a pixel or two. Use either tool to select a row or column of pixels at the bottom or side of the image, grab the Move tool by pressing V, and then tap an arrow key on your keyboard while holding the Option key (Alt on a PC) to nudge the selection in the direction you need and duplicate it at the same time. However, a better option is to use Content-Aware Scale (see Content-Aware Scaling).

  • Making an image look like it’s melting or traveling through space at warp speed. Arguably the most amusing use for these tools, you can create a selection and then stretch it with the Free Transform tool (see Figure 4-5).

Good luck catching this hen!To achieve this look, use the Single Column Marquee to select a column of pixels. Then “jump” the selection onto its own layer by pressing ⌘-J (Ctrl+J). Next, summon the Free Transform tool by pressing ⌘-T (Ctrl+T), and drag one of the square, white center handles leftward. Last but not least, add a gradient mask (page 294), and then experiment with blend modes until you find one that makes the stretched pixels blend into the image (page 296 has more on blend modes).(Unfortunately you can’t activate the Single Row and Single Column Marquee tools with a keyboard shortcut; you’ve got to click their icons in the Tools panel.)Create your own speeding hen by downloading the practice file Hen.jpg from this book’s Missing CD page at www.missingmanuals.com/cds.

Figure 4-5. Good luck catching this hen! To achieve this look, use the Single Column Marquee to select a column of pixels. Then “jump” the selection onto its own layer by pressing ⌘-J (Ctrl+J). Next, summon the Free Transform tool by pressing ⌘-T (Ctrl+T), and drag one of the square, white center handles leftward. Last but not least, add a gradient mask (page 294), and then experiment with blend modes until you find one that makes the stretched pixels blend into the image (page 296 has more on blend modes). (Unfortunately you can’t activate the Single Row and Single Column Marquee tools with a keyboard shortcut; you’ve got to click their icons in the Tools panel.) Create your own speeding hen by downloading the practice file Hen.jpg from this book’s Missing CD page at www.missingmanuals.com/cds.

The Vector Shape Tools

Technically, vector shapes aren’t selection tools, but you can use them to create selections (turn to Drawing with the Shape Tools to learn more about vector shapes). Once you get the hang of using them as described in this section, you’ll be reaching for ’em all the time.

Perhaps the most useful of this bunch is the Rounded Rectangle tool. If you ever need to select an area that’s rectangular but has rounded corners, this is your best bet. For example, if you’re creating an ad for a digital camera, you can use this technique on a product shot to replace the image shown on the camera’s display screen with a different image. Or, more practically, you can use it to give photos rounded corners, as shown in Figure 4-6. Here’s how:

  1. Open a photo and activate the Rounded Rectangle tool in the Tools panel.

    The vector shape tools live near the bottom of the Tools panel. Unless you’ve previously activated a different tool, you’ll see the Rectangle tool’s icon. Click it and hold down your mouse button until the drop-down menu appears, and then choose the Rounded Rectangle tool.

    Tip

    To cycle through all of Photoshop’s shape tools, press Shift-U repeatedly.

  2. In the Options bar, set the tool’s drawing mode to Path and change the Radius field to 40 pixels (or whatever looks good to you).

    As you’ll learn on Photoshop’s Drawing Modes, the vector shape tools can operate in various modes. For this technique, you want to use Path mode. Click the unlabeled drop-down menu near the left end of the Options bar (it’s probably set to Shape) and choose Path.

    Next, change the number in the Radius field, which controls how rounded the image’s corners will be: A lower number causes less rounding than a higher number. This field was set to 40 pixels to create the corners shown in Figure 4-6. However, you’ll need to use a higher number if you’re working with a high-resolution document.

  3. Draw a box around the image.

    Mouse over the image and, starting in one corner, drag diagonally to draw a box around the whole image. When you let go of the mouse button, Photoshop displays a thin gray outline atop your image called a path, which you’ll learn all about in Chapter 13. If you need to move the path while you’re drawing it, press and hold the space bar. If you want to move the path after you draw it, press A to grab the Path Selection tool (its Tools panel icon is a black arrow), click the path to activate it, and then drag to move it wherever you want.

  4. Add a layer mask to hide the area outside the path.

    In the Options bar, click the Mask button and Photoshop adds a vector layer mask to the image. (Why a vector mask? Because the path you drew with the shape tool is vector-based, not pixel-based. As you learned in the box on Raster Images vs. Vector Images, you can resize a vector any time without losing quality by activating it and then using Free Transform [The Transformers]. For more on vector masks, skip to Using Vector Masks.) You can do the same thing by ⌘-clicking (Ctrl-clicking) the circle-within-a-square icon at the bottom of the Layers panel to do the same thing. Either way, Photoshop hides the photo’s boring, square edges.

If you’re tired of boring, square corners on your images, use the Rounded Rectangle tool to produce smooth corners like the ones shown here. Be sure to put the tool in Path mode first using the drop-down menu near the left end of the Options bar, or else you’ll create a shape layer that you don’t really need. (You can use this same technique with the Ellipse tool to create the vignette effect shown in the previous section.)To feather the layer mask after adding it (see step 4), double-click the mask and then drag the resulting Properties panel’s Feather slider to the right.)Happily, you can alter the roundness of these corners after you’ve drawn the shape. Page 588 has the scoop.

Figure 4-6. If you’re tired of boring, square corners on your images, use the Rounded Rectangle tool to produce smooth corners like the ones shown here. Be sure to put the tool in Path mode first using the drop-down menu near the left end of the Options bar, or else you’ll create a shape layer that you don’t really need. (You can use this same technique with the Ellipse tool to create the vignette effect shown in the previous section.) To feather the layer mask after adding it (see step 4), double-click the mask and then drag the resulting Properties panel’s Feather slider to the right.) Happily, you can alter the roundness of these corners after you’ve drawn the shape. Page 588 has the scoop.

Who knew that giving your photo rounded corners was so simple?

To place your newly round-edged photo on top of another background in presentation software or on a website, choose File→Save As and pick PNG as the format. (As you know from Chapter 2, the PNG format supports transparency. You’ll learn more about this format on Choosing the Best File Format.)

Get Photoshop CC: The Missing Manual, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.