[Tutorial] Awesome Extractions: Isolating Elements

One of the things I’ve struggled with forever in Photoshop is “extracting” or “isolating” a portion of the photo. It’s almost a required skill for photomanipulation, product photography, and digital scrapbook design, as well…but I had tried every technique I knew and I could never get a result I was happy with. I’d spend hours on a simple photo, think I was finished, check for stray pixels, and discover I had even more hours to go. Then I’d resize after all the stray pixels were cleaned up, and the edges would go all blocky! I tried just using an eraser brush, the magic wand, Photoshop’s background eraser tool, the lasso tool…and nothing worked well enough that I was happy with it, either with a mouse or my graphics tablet.

All that changed a few weeks ago, when I learned another technique. Now it’s the one I try first, because I haven’t run into a photo it doesn’t work on, assuming that the photo’s been shot clearly in the first place. And the reason it works is dead simple to any digital scrapbooker; it’s using a shape as a clipping mask. Digiscrappers use clipping masks when we use a page layout template, or when we’ve got an odd-shaped frame or are blending a photo onto a page. Designers use them when designing a new element from a custom shape, too, because custom shapes can be made any size without going jaggy. (Yes, when you drastically resize a rasterized version, it will still pixelate at the edges, but if you’ve made the shape the size you want in the first place, the scrapbooker won’t have enough pixellation to notice on a layout.)

What if you could have the edges stay perfect? That’s what this technique is all about. By creating a shape layer, only the parts you’ve selected are clipped out, and since shape layers are vectors until and unless you rasterize them, your cut-out element can be resized with no loss of quality on the edges. (Obviously, don’t try to resize the cut-out larger than its original size in the photo, or the PHOTO part will start showing pixellation, but as long as you’re not doing that, it’ll turn out perfectly no matter how much smaller you make your completed extraction.) They still take time, but I don’t have to worry about whether the photo has a solid-color background, missed (stray) pixels outside my isolated image, or jagged edges when I resize. I just have to make sure I’ve done the outline as close to the outline of the element as possible and then gone back and removed parts inside the shape where the background shows through in the middle, then use the shape as a clipping mask. Best of all, it can be done with any version of Photoshop made within at least the last 10 years, and works just as well with a mouse as with a graphics tablet, so literally ANYONE with Photoshop has the tools to use this technique!

Selecting an Image to Isolate

Step1
Let’s get started by talking about what makes a good image to extract. Lots of people will tell you it should be super-high resolution on a solid-color background. While the one I’ve chosen to use for this tutorial is, that’s not necessary with this technique; you just need to have a clear view of the part you want to extract (no little leaf in front of it, etc.) and the photo needs to be focused and exposed properly. Even better, you don’t even need a high-end camera to make this work for small elements–even an in-focus 2MP snap from a cheap cell phone will work, if you’ve taken the photo in good diffused lighting (so there aren’t harsh shadows) and made your subject only slightly smaller than the image. You won’t be able to make it a huge element, of course, given that 2MP is usually about the pixel dimensions of a 3×4 journal card, but how often is a flower or a charm made much larger than 2″ in a kit?

I’ve chosen this little evergreen twig as the image I’m isolating today because if it works on complex stuff like this, it’ll work on any flower or object you throw at it. Don’t worry if your element’s edges have a 1-2 pixel blurry edge when you zoom in to 100%; that won’t matter when resized. More blur than that will probably show in the face of your element being blurry, even if the edges are perfectly crisp, so be sure you’ve chosen a good picture. Mine’s actually got about 3 pixels of edge blur, but the original photo is 12MP, so it really won’t be noticed in a finished element that’s no more than 4″ long. The lighting isn’t quite perfect; I’d have liked a little more contrast, but the only other option I had would have caused it to have harsh shadows, which would restrict the finished element’s use to whatever angle made those shadows look right with the rest of the layout.

Setting Up to Extract Your Element

Step2
Obviously, the first step is to load your chosen image into Photoshop. After that, we’ll set up by duplicating our original image onto another layer, and then adding another layer in between the two in the Layers palette. It’s a very good idea to save your PSD or TIFF at this point, so you can save it easily later while you’re working on the shape layer for the isolation.

“But I don’t have a shape layer, just a regular one!” Don’t worry, Photoshop is smart. Once you get started making the outline, it’ll turn the layer into a shape layer, provided you’ve got the right setting on the pen tool.

“Pen tool? I don’t know how to use that! It’s way too complicated!” It’s definitely a lot different than using an eraser, but it’s worth the effort to learn, and I’ll try to make it as simple as I can.

So go on over to your Tools palette and choose the Pen tool (circled in red), then go up to the upper left corner and select the second icon in on the Pen tool’s controls bar–the one that looks like a white square with control points showing at the corners. Make sure you’ve got your new middle layer selected; that layer will become your shape layer when you start using the Pen tool.

Using the Pen Tool: A Basic Primer

Let’s talk about Pen tool controls for a minute here; understanding these is what will lead to your being able to do a high-quality extraction, and it’s not as scary as it’s always looked to me.

The simplest thing you can do with the Pen tool is left-click. That will place a new control point, and if you only click and don’t drag it, the point it adds will be a corner point; that is, the path coming into it will come straight in and the one leaving will go straight toward the next control point.

If you need a smooth curve, though, just clicking isn’t the answer; you want to left-click and drag the cursor so that the line of the path matches the curve. This does take a little practice, but once you learn how to do it, you can make any curve you want. If you remember your high school geometry, clicking and dragging like this produces a tangent line–one that only touches the curve at one point. The handles control how far along the path the curve extends; short handles only affect a small section of path, making a tighter curve, while long handles affect a longer portion of the outline and make more sweeping curves.

Let’s say you’ve got a tangent point made, with its handles dragged out, but it’s not quite right. The Control/Option key is your friend here. You don’t have to hit Ctrl-Z to undo it and try again, though sometimes I do anyway. But for a point that’s a little ways back, I don’t want to have to redo it and all the points I’ve done since; it’s far easier to just move the point or its handles to adjust the section of curve it controls. If you hold down Control (or Option on a Mac), your cursor will change to an arrow. You can then click and drag the middle point of the 3 to move the point and its handles as a group, and the control handles will stay in the same orientation as they currently are. If you Ctrl-drag one of the handle endpoints, it’ll turn the handles, rotating around the point where the tangent line touches the curve.

The Alt key works similarly with the points, but instead of moving the tangent point and its control handles as a group, it operates on them individually, letting you make that curve be tighter on one side than the other, or turn your smooth curve into a corner between two curves. Alt-clicking and dragging on a handle will move just that handle, allowing you to make it shorter, or make a corner there. If you Alt-click the center point, it will remove the control handle going out of the point in the direction you’re proceeding around the object, which can be useful if the edges of the item you’re extracting are particularly intricate.

There are a few other things you can do with the Pen tool, but those are the ones we need to know for right now. I’ve summarized them on the image below for easy reference.
Step3

Start Creating the Shape

Look at your image, and see if there’s a good spot to start from. You can start anywhere on the outline, but I usually prefer to start at a sharp corner or on a long, nearly straight curve. Double-check to make sure you’re creating shape layers with the Pen tool, then place a point on the edge of your object. Now move around the edge a little bit and place another point. Which direction you go around is a matter of personal preference; the path will eventually make a closed loop whether you go clockwise or counterclockwise (anticlockwise for those of you who speak the Queen’s English).

This is the part that takes time, but it does get easier with practice. Just make sure you’re placing your points and dragging out handles so that the path you’re drawing matches the outline of the element as perfectly as you can. If you’ve got parts of the background showing through the middle and surrounded by your object, just leave them in the middle for now; we’ll get them in a little while. For now, just work your way around the outside, remembering to save every so often so that your path will be saved in the event of a sudden power failure or program crash.

Checking and Closing the Outside Path

Step4
Once you’ve made it almost all the way around, stop for a minute and double-check the entire loop you’re about to close. Once it’s closed, you can’t move the points around without undoing to where the path is still open, so make sure now that no points or curves need to be adjusted to make it perfect.

After you’ve made sure that everything else is just right, if you hover over the first point you made, your cursor will change to show a circle just below and to the right of the Pen tool’s normal cursor. That tells you that if you left-click on that point, it’ll close the path. Go ahead and click the point, and your series of points will change to a solid line around your object.

Step5

At this point, I like to do a little work in the Layers palette. First, I click the eye icon next to the “Background” layer where my original photo is located, hiding it. Then I hold down Alt and click on the line between the top two layers, making the shape layer a clipping mask for my “Background copy” layer. This lets me double-check the edges to make sure they’re perfect.
Step5b

Removing Enclosed Sections

If you’re extracting an object that doesn’t have any open spaces in the middle, you can skip this section and go straight to resizing and saving. Unfortunately, most objects will have some little bits you’ll need to remove here–the background showing through between leaves, inside a loop in a bow, between a couple of petals on a flower, etc.

Make sure you have your shape layer selected, and are using the Pen tool. Go up in the Pen’s toolbar, in the 5th section from the left, where it has 5 different sets of squares, and choose the middle one of them, the one that looks like the lower-right square has been cut out of the other one, leaving an upside-down L shape. That option tells Photoshop that we want to subtract the new path we’re drawing from the shape layer we’ve got selected.

Step6

Just like creating the path for the outside, make a set of points for each section where the background needs to be taken out of the middle and close the loop. I like to start at one end and work my way methodically across the image so that I don’t miss anything that needs removing. If you’ve got the shape layer clipped, it can sometimes hide part of what you’re trying to remove; if that happens, just click the eye next to the bottom layer and show it so you can see where your inner path needs to go. You can always turn it back off when you’re finished, before you save your new element.

Finishing and Saving Your Isolated Element

Step7
Once all your enclosed background is removed, all you need to do is make sure the bottom layer is turned off so that the background is transparent. Go up and select Image>Trim… from the menu, and choose Transparent Pixels and OK from the dialog box that pops up.

If you want to save the element in its original color, then just go ahead and save as a PNG right now.
If you want to turn it into a greyscale template, add a Hue/Saturation adjustment layer and move the Saturation slider all the way to the left, then adjust the Lightness slider so that it’s not too light or dark before you save it as a PNG.

Bonus for layout template designers!!
You can turn off visibility on the upper layer, just have the shape layer showing and selected in the Layers palette, and go to Edit>Define Custom Shape to create an ultra-realistic shape that you don’t have to worry about getting in copyright trouble for using. 😉
BonusStep

4 thoughts on “[Tutorial] Awesome Extractions: Isolating Elements

  1. If you’ve made the attempt, I’d love it if you’d link to a small image or screenshot of an item you extracted using this method. Show off your new skills! 🙂

  2. BOO! No pen tool in PSE. Will file this info away for later, if I ever upgrade to full photoshop.

Leave a Reply

Your email address will not be published. Required fields are marked *