Ok so this tutorial is just some simple selection techniques which you can use in Photoshop to grab areas of an image for editing purposes. This is what I’ve learned from experience so it might be a little lacking in areas, feel free to add your own comments if I’ve missed something. These techniques are useful for masking, combining exposures (something I will expand upon in a second tutorial), cloning out items within a set space, and so on. If you would like more information on the specifics of anything ask and I’ll add to the tutorial with that additional information.
This will be a fairly interactive tutorial because I don’t want to upload images for every instance of selecting and previewing that selection. If you want to play download the SEL.sample.jpg and SEL.refine.jpg and open them in Photoshop.
I use Photoshop CS5 but this should work for any version as far as I’m aware.
Magic Wand Tool
And this is what my Wand Tool options look like in CS5. The appearance may vary for older versions. The second row is the relevant one, which from left to right shows:
- The wand tool is selected.
- The selection type. The different boxes indicate what clicking will do to change the selection, but this choice is the most versatile.
- Tolerance. Meaning how much variation the selection will accept.
- Anti Aliasing. Whether the selection is smooth or pixelated.
- Contiguous. If this is ticked, you click to select a yellow area and it will select only that area. If it is not ticked, you click a yellow area and it will automagically select every similar yellow area on your image. I leave this on to keep things easy to anticipate.
- Sample All Layers. Whether to use the whole layered psd to select from or just the current layer.
- Refine Edge. Tweaking your selection – more later.
This is a good image to test the basic selection techniques on. Select your wand tool and use the settings from wandtool.jpg for now. Click one of the boxes and it will obviously select that area. Then you need to specify various other selection options to add or remove other areas.
Shift+click will add the new area you clicked on. Alt+Click will remove a currently selected area. Those are the two you’ll want. Click anywhere else to deselect, or alternatively hit Ctrl+D. Try adding and removing boxes to and from your selection.
Deselect then click in the middle of the gradient. You should get an area roughly the height of one of the boxes. That is because you have a tolerance set at 25. If you deselect, change the tolerance to 75 and click the center of the gradient again you’ll get a much larger area. This is because you’re telling Photoshop to be less choosy over the selection of tones to pick.
If you’re trying to select all the white in an image, for example burnt out sky, but you’re getting a lot of light blue in the selection too, try lowering the tolerance.
Select Colour Range
Another way to make a selection is to use Colour Range. You can find this by clicking the Select drop down, then (oddly enough) Colour Range. If you have a particular purple selected as your Foreground Colour it will automatically assume you want to select that colour, but you can also then click anywhere in the preview to choose a colour from that area of the image. In this case, pretty much black or white.
The drop down at the bottom of this tool, in which I’ve chosen Greyscale, will change the preview to show the areas that will be selected in white. Not obvious in a black and white image, but if you check the gradient area you’ll notice very little of the gradient is going to be selected as it’s mostly black. Adobe have kindly changed the term to make PS more user friendly, but you can tweak the Fuzziness of the selection which will do more or less what Tolerance does with the Magic Wand tool.
This image represents a few Refining results, so if you’re playing along at home delete the top right and bottom left circles and just keep the top left to begin with.
If you have the magic wand selected you will have this button appear in the top menu as per the first image. However if you are using another tool and wish to refine your selection you can find it in Select / Refine Edge (again, to keep things user friendly, Adobe change the name…)
Ok, so select your magic wand, untick Anti Aliasing and set tolerance to 0. Click the top left white circle to select it, then on a new layer fill that circle with white and move it to the top right so you can compare the two. You will have a rubbish pixelated circley thing. Not very useful, but sometimes if you have to use a very low tolerance you will get a very pixelated selection as a result. So…
Hold Ctrl and click on the layer in the layer panel which contains your crap pixelated circle. If you don’t have your layer list open go to Window / Layers or hit F7. Ctrl+click on a layer selects the contents of that layer. Now create a new layer, move your unfilled selection to the bottom right and then open the Refine Selection dialogue box. You can move a selection by selecting the Marquee tool and then click and dragging your selection around.
- Radius. Does weird things, I think it adds a semi-selected border around your selection but I don’t know why it would be useful. bump it up a bit to see what I mean.
- Smooth. Smooths.
- Feather. Blurs the selection at the edges, similarly to how a Gaussian Blur works except in select form.
- Contrast. Similar to Tolerance, it means you can select less grey. For example, add a feather of 5 pixels, now bump your contrast up to 100% and watch the contrast eliminate the grey areas and give you a solid black shape again.
- Shift Edge. Moves the selection in or out a fraction.
For this selection I used the settings 0, 5, 0, 30, 25. So I smoothed 5%, upped the contrast 30% and shifted the edge of the selection out a fraction. As you saw above, you can also play with feather and contrast but this is often better for getting a blurry solid colour sharper rather than for playing with photos because the result is less precise.
Fill the circle and you’ll see roughly what I have, not a perfect result but it’s pretty close and much better than the pixelated monstrosity that we had before.
If you make a selection, then go to Select / Modify you will get some additional options:
- Border. Changes the selection to the outline of whatever you had before. For example, if you have a circle selected, then you modify the border to 4px and fill the result you will have a 4 pixel deep ring rather than a circle. Good for drawing polos.
- Smooth. Softens curves, I don’t have a sensible use here. There are better ways to do this, above.
- Expand. Expands your selection, in pixels. ie. Making your selection larger all round.
- Contract. Contracts your selection, in pixels. ie. Making your selection smaller all round.
- Feather. Blurs the edges of your selection, as above.
That’s all fairly self explanatory really.
Drawing Selections With The Pen Tool – You will need some time with this section!
The pen tool is for when you don’t want to use one of the rough automatic selection tools. It’s tricky and complicated to get the hang of but once you’ve used it a few times you’ll find it very handy indeed for smooth selections.
These are the tool options. Now this is actually a Vector tool. If you don’t care or already know what that means, skip the next paragraph. It’s not that relevant but it is kind of interesting
Vectors are shapes made up of mathematically calculated curves, which each have an equation to define them. So you add a dot, then another dot and the line connecting them has it’s own equation. You add another dot and you get another equation between 2 and 3, and so on until you have completed your shape. Those of you who remember much maths from school (and who doesn’t?) will know that it’s only the form and direction of the curve that matters, not how large your draw it. That means that a Vector shape is scale-able without loss of quality, which is not true of pixel-based shapes – known as Raster shapes.
It doesn’t matter too much from a photo editing point of view, but for illustration or other uses it’s pretty good to know the difference.
So anyway, what does all this crap mean? Well…
- Pen Tool Selected
- Type of Vector. Will you create a vector shape, or create a vector outline to perform raster tasks?
- How to draw. Point to point, free hand drawing like the paintbrush, or with standard shapes?
- Auto Add/Delete. Uh, something.
- Intersecting Path Options. Similar to the magic wand tool, this is for subtracting paths from each other and so on.
Basically for the purposes of this tutorial, use the settings I have above. You can play with the others but this is the most useful set up for photo editing.
So create a new document with a black background, or use your current document with a new layer. Select the pen tool and start clicking around. You’re starting to draw a shape, probably at random, which is made up of lots of individual dots and straight lines connecting them. Basic, and not very useful, but you get the idea. Now hold shift and add a few more points. Those new points will appear in perfect horizontal or vertical lines rather than at whatever rough angle you actually clicked on, a rather nifty little bonus.
Now hit escape to unselect your current path, and the dots will vanish. You could in theory now start creating another path, or you could be doing other tasks and then come back to your path later. For example you could have been clicking around making your path, then decide that actually you will go ahead and add that new layer and fill it with black to make things easier to see, as I suggested earlier and which you ignored because you knew better.
To then resume editing your path, hold ALT and click the path. The dots will reappear. None of the points will be filled, which means none are the currently active point but you can now see them. Click one of the end points and it will fill with white, which then shows it to be the active point, and you can continue to draw your shape. It doesn’t matter which end you want to continue drawing from.
Now hit Escape, and Escape again. Fuck, you’ve lost your path. Gone. Do not start drawing a new path yet, go to Window / Paths and you will get a list like the Layers list but it will have your Path.
Now unlike Layers, the top path is considered re-writable by Photoshop. You’ll see what I mean if you make sure you’ve hit escape twice and hidden the path, then start drawing a new path. The old one is gone and replaced by your new work in progress path. Now this time it really is gone.
You can avoid that by creating new path layers, as you would with normal layers. Create a shape, create a new layer on top, and your first shape will be saved on the first layer and the new top layer becomes the re-writable one.
Anyway, since you’ve only been making jagged blocky shapes it doesn’t matter yet. Hit escape twice and remove any layers you already have. Now start a new shape, click your first point, then instead of just clicking for new points click and hold, then move the mouse to make a curve before releasing. Then do it again, click and hold, move the mouse and make another curve.
Hopefully you can start to make a shape like this:
Curves are much more useful, but they do add little extra lines and points, and these small extra points we’ll call Nodes.
In this image I started middle left, went up, middle right then the current active point is the bottom one. The bottom point has two nodes, one forward and one back, and the point behind it has just one node – the forward node. Nodes are what dictate how to form the curve, one leads the path out of the previous point and one leads it into the current point.
To edit the nodes, hold ALT then click and hold one of them and drag it around. In this case either pick the backward node for the current point, or the forward node for the previous point. Dragging it around will move the curve around.
To make it more simple to see what’s going on, escape out of that path and create a new one. Make a starting point, then click, hold and drag to create a curve and show the nodes for your current point. ALT+click the forward node and drag it to a direction 90 degrees away from where it was originally pointing, then release and create another point. You should end up with a sharp corner where you told the next curve to head off in a different direction by moving the forward node, something like this:
At this point you need to have a play on a real image really. Download this image and open it up:
In this case if you wanted to, say, desaturate the wallpaper but not the chair, it’s too complicated and muddle a scene to get a sensible result with the wand tools or select colour range, so your best bet is to draw around the chair. Go ahead, it’s only practice. Remember you can Ctrl+Z at any time to undo, and you can open your History panel (Window / History) to skip back several steps. You can also ALT-click a point and hit delete to remove it, but once that point is gone you have a general selection of the whole shape rather than the next point along. That means if you hit delete again you remove the whole shape.
As well as deleting points you can click anywhere on your path to add a new point in that area, then ALT+click that point to move it around as you would one of the nodes.
The aim here is to try and capture the curves by using as few points as possible while still staying in control. See the arm of the chair in the close up below? That’s one curve with no points in the middle. It’s a smooth curve so I could make that just using a starting point and finishing point and using the nodes to control the size and direction of the curve.
The darkness is added just to make the path easier to spot.
Don’t worry if your path looks like crap and doesn’t follow the lines quite right, it’s not easy to begin with. For now just try to get it right. Once you’re done with the outside, do any gaps as well, such as between the arms and the chair:
I’m not trying to be sadistic, fun though it is, but there is a point. And you’re getting to it.
Once you’re done, right click with your pen tool to bring up some options:
- Create Vector Mask. This will mask your chair with a new vector shape (try it if you like).
- Delete Path. Don’t do this. Use the history window if you do by mistake.
- Define Custom Shape. This will save your chair path shape into the custom shapes list, which you can find at the top in the list of circle, square, etc. The end squiggly blob one is the custom shape list where you can save your new shape into if you wish.
- Make Selection. This will make a selection of your current shape, in a lovely smooth selection so you won’t need to Refine it. You can then copy and paste, make a regular layer mask, and so on.
- Fill Path. Create a new layer then fill your path. This means at any time you can come back and Ctrl+click that layer to reselect your chair shape without risking losing it, and it means you can make new selections and delete portions of it if you’re not yet comfortable playing with one large selection and adding and subtracting as you go.
- Stroke Path. This will apply the current Paint Brush tool settings to the path. If you have a 5px circular paint brush selected (Hit F5 to bring up all the many details for the paint brush) then it will apply a 5px stroke to the path.
- Clipping Path. Not sure what this is, probably a vector mask of a vector shape or some such. Ignore it.
- Free Transform Path. Will allow you to move and stretch your new path, not very helpful here.
The two you probably want to concentrate on are Make Selection or Fill Path – but make sure to fill the path on a new layer! You’ll notice with both that any areas you have created inside the first shape, such as cutting out under the arm in the preview, will automagically be subtracted from the final shape.
Here I created a new layer and filled with white. Hopefully your final result looks similar, albeit not zoomed in any.
Remember once you have filled onto a new layer you can select the contents of that layer by Ctrl+clicking that layer in the layer list (window / layers). As I mentioned, you might find it safer to “save” your selections by filling them in new layers as you’re getting used to the tools.
Cutting out items or making selections in this way is useful for many things, such as selective desaturation – if you want to desaturate everything other than one object rather than everything other than one tonal range. Alternatively making complex masks which allow you to use the clone tool to repair background areas of an image without cloning over the foreground subject.
It probably seemed like a huge effort, but once you’ve played for a bit it becomes second nature and can be quicker (and more accurate) than playing with Magic Wand settings.
Anyway, I hope that helps someone. I’ll put a second tutorial together to show how to use these selection techniques to combine images, mess around with masks and so on