Selecting in Photoshop

Articles > Photoshop > Selecting in Photoshop

Photoshop has more ways to select pixels than you can shake a stick at. So what are they, and how do you decide which one to use? Basically, you have four choices: you can use the selection tools, a quick mask, the layers window, or the selection menu. At the end of this article is a brief example showing how you would choose between these techniques in a real-world situation.

Selection Tools

Tool PaletteThe most obvious way to select is using one of the selection tools. The Marquee Variationsrectangular marquee (accessed from the keyboard by pressing M) lets you drag out a rectangle and select it. Its close cousins the elliptical marqee, single row, and single column can be accessed by pressing the mouse button on the marqee icon and holding it down for a few seconds. You can also change tools by pressing Shift-M (pressing M selects the marquee, and holding the Shift key walks you through the variations).

The Lasso Variationslasso tool lets you draw an arbitrary path and select what's inside it. For more precise control you can use the polygonal lasso to create straight lines and the magnetic lasso to have the selection 'cling' to an object in the picture. Did that last bit make sense? What I mean is that if you click next to an apple in the photograph and then drag around the apple, the magnetic lasso will trace the edges of the apple. Specifically, it traces the boundary between two dissimilar colours (in this case, the red apple and the non-red background).

Marquee Options
With both the marquee and lasso tools you can hold down modifier keys to change the way they work. Holding the Shift key adds to the current selection, while holding the Option key (Alternate key on Windows) subtracts from the current selection. Holding both keys at once creates an intersection (the new selection is the area that was previously selected and falls within the new area you specify). You can also access these features using the options bar — the first four icons shown above.

Feathered SelectionYou can enter a feather amount and the selected area will be made 'fuzzy'. Of course it will still look crisp on the screen (the little dotted line doesn't get blurry) but when you perform an operation you will notice the fuzziness. In the example shown on the right, notice that some areas inside the marquee are still gray while some areas outside the marquee have become lighter. That's feathering.

Note that feathering must be specified before you drag out the selection — it has no effect on the already-selected areas. If you want to feather an existing selection you use the Selection menu (see below).

The lasso tool can also be Anti-Aliasinganti-aliased. Anti-aliasing is a special form of feathering that prevents straight lines from looking jagged.

Marquee StyleThe marquee tool also allows you to specify the style of selection. Normal style means that the rectangle rubberbands from where you press the mouse to where you release it. You can also specify a fixed aspect ratio or a fixed size, and the shape of the rectangle will be constrained accordingly.

Magic WandUsing the magic wand tool you click on the image and all the pixels that resemble the one you clicked on will be selected. In other words, if you click on a red apple, the entire apple (or, at least, all the parts of it that are red) will be selected. You can use the shift and option (or alternate) keys to add to or remove from the selection just as with the marquee and lasso tools. And, like the lasso, you can choose to anti-alias the selection.

Magic Wand Options
The magic wand has three extra options that the marquee and lasso do not. You can specify a tolerance for the magic. A tolerance of zero means that only pixels that exactly match the target pixel will be selected. As the tolerance increases, the match gets more forgiving, so that red and orange will both be included in the selection. If you aren't sure how much tolerance you need, 32 is a good place to start.

If you say that the magic wand is contiguous only pixels that are touching each other will be selected — if you click on an apple then only that apple will be selected by the operation. If you turn off contiguous selection then a single click can select every apple in the orchard. And it will also select the red tractor, and the red wagon, and so on.

Finally, you can specify that the magic wand samples all layers or only the active layer. Suppose your there is another layer — a worm — on top of your apple. If you are sampling all layers and click on the apple you will not select the portions that are covered by the worm. If you are not sampling all layers you will get the entire apple; the worm layer is ignored.

Move ToolBelieve it or not, the move tool can also be used to make (modify, actually) your selection. When you begin to move the selected pixels, the selection automatically 'collapses' to include only non-transparent pixels. This provides a very handy way of making a selection: just press Apple-A (Control-A on Windows) to select all, then press Apple-UpArrow (Control-UpArrow on Windows) to move the selection up one pixel and Apple-DownArrow (Control-DownArrow) on Windows to move it down again. Hey Presto! The selection has collapsed to include only the non-transparent portions of the layer.

Quick Mask

Quick MaskThe quick mask is a feature of Photoshop that many people never stumble across, which is a shame because it's occasionally very handy. Normally you are in standard mode and when you paint you are changing the pixels of the image. But if you switch to Quick Mask Examplequick mask mode (via the rightmost of the two buttons) you will be painting with semi-transparent red... and when you switch back to standard mode you will see that the parts of the image that you painted red are now selected.

Or perhaps the opposite happens — the transparent areas are selected instead of the red. If you double-click on the quick mask button you get an options window that lets you specify the overlay colour (which defaults to red) and whether the red areas represent selected or non-selected pixels.

You might be wondering "so what?" and I'll tell you. Quick mask is, hands down, the fastest way to tweak a selection. Use the magic wand to select the apple, then flip to quick mask mode to paint in the apple stem (which the magic wand missed because it wasn't red). Even better, you can copy the quick mask and paste it into a temporary layer. If you ever need the selection again, just copy that layer, flip to quick mask and paste, and flip back to standard mode. The selection is restored.

Layers WindowYou can also do anything to the quick mask that you can do to ordinary images. You can scale it, rotate it, change its brightness and contrast, whatever you want. This is powerful.

Layers Window

If you Apple-Click (Control-Click on Windows) on a layer in the Layers Window then the selection will be set to match the non-transparent pixels in that layer.

Select Menu

Select MenuBy far the most powerful, and often most confusing, way of working with selections is via the Select menu. Certain commands are fairly self-evident: All selects the entire canvas and Deselect selects nothing at all. Inverse reverses the current selection so that previously-unselected pixels are now selected and vice-versa.

The Feather command feathers the existing selection as described earlier under the marquee tool. The Modify SubmenuModify submenu contains commands that let you adjust the current selection. The Border command creates a selection that runs around the edges of the current selection (i.e., if you had selected a round apple, creating a 4-pixel border would result in a selection that contained the area just outside and just inside the apple, but the middle of the apple would be deselected). The Smooth command will smooth a jagged selection, and the Expand and Contract commands move the selection boundaries out or in.

The real find, however, is the Color Range command. This operates like the magic wand, but with much greater control.

Example

So how would we go about selecting the apples in the following picture?

Apples The rectangular marquee tool is no good because the apples aren't square. The elliptical marquee tool looked promising, but it is far too tedious to try to wrap each apple individually. I tried the magic wand and gave up because the yellow highlights and black shadows were messing me up. I took a shot with Select > Color Range but discovered that even with the finer control I was running into the same problems that the magic wand had given me.

In the end I used the quick mask. I entered quick mask mode, chose a nice round paintbrush that was just smaller than the smallest apple, and proceeded to 'paint' the apples red. When I was finished entered standard mode, and everything except the apples was selected. I pressed Shift-Apple-I (or Shift-Control-I on Windows) to invert the selection and I was done.

References

See also:

Other intermediate photoshop resources: