Extracting forms from photographs can be a daunting task if you’re not familiar with the full potential of Adobe Photoshop. The first time I tried to do it, I used the selection tools, which was really scary, because I didn’t know an effective way to correct any errors that I made (there are actually plenty of ways to correct these types of mistakes, but I can be pretty slow to catch on sometimes). Soon afterwards, I became familiar with the magnetic lasso selection tool, which tries to find the edge of your form for you. This is usually a bad idea, as I soon discovered. It produces mediocre results at best, and is a tragic waste of time, most of the time.
Some forms can take a long time to pull out, perhaps even hours. Doing this with the selection tools can seem almost unreasonable, even with undo and history, because you spend so much time creating one selection shape. If you mess up that shape, you can’t undo just the part you messed up on; the whole shape counts as one move, so you either undo the whole thing or move on.
There are several ways around these initially confusing dilemmas, but I’m going to skip that for now and move on to a much more effective way of extracting forms: Shape Layers. Shape layers are a much better tool to use when extracting forms, for the single reason that they make use of the pen tools and vector shapes. The pen tools are far better than the selection tools when extracting forms for several reasons:
I need to state here that almost all of the tasks mentioned in the above list can, in some form or another, be done with selections; however, it will generally be far more difficult, awkward, and time-consuming, and you may even have to use a shape layer to do it right. By the time you’re done with all the acrobatics it will take to get the job done with selections, you could have just spent a very short amount of time learning the pen tools, and then made up for that very quickly with the countless hours you would save doing it the easy way and enjoying all of the subsequent advantages.
So let’s get started, shall we?
Select the pen tool in the tools palette. Make sure that you’ve selected the standard pen tool; there are multiple variations of the pen tool that will fly out from that button if you hold it down, all of which serve great purposes, but you should begin with the standard pen. You should be able to tell, because most of the tools look like a pen, but all of them except the standard pen tool have a very small symbol by the pen to indicate a variation in its usage.
In the Options Palette, which is usually located at the top of your interface, take note of the three modes that are available for vector tools to work in. Use the “Shape Layers” mode, which should be the first option. You can tell by letting your mouse float over the icons until a tool tip appears, which will tell you the name of the tool. The other mode that can be selected while using the pen is “Paths”, which is not necessary for this exercise. Even if you decided that you need to create a path, be aware that in “Shape Layers” mode, each shape that you create is, in fact, a path. The only difference is that the path is also stored in a vector layer in the layers stack, which makes it easier for you to use and modify.
Once you have ensured that all of the settings are correct as described above, you can begin creating your vector shape. This is as simple as clicking anywhere on your photograph, though you would obviously want to begin on the edge of the form you are going to extract. Each time you click on your photograph, a line will be created between your last clicked position and your current one; this is the beginnings of the vector shape. You will notice that each place that you click has a tiny square that the lines connect to. I’m not sure what Adobe calls these, and I’m too lazy to look it up right now, but for the sake of this article, we will call them vertices (plural) or a vertex (singular). I may also refer to them simply as points. Some of these vertices may also have one or two antenna-like stems protruding from them, besides the lines of the vector shape. Again, for the sake of this article, we will call these curve control handles, because they control the way that the lines of the vector shape curve. I may refer to the curves as tangents, and I may refer to the way that the lines curve, or the degree or intensity of their curve, as tangency.
Once you have laid down several vertices, your vector shape will begin to take on some degree of volume, meaning that you will begin to see the color in the center of the shape. At this point you will probably want to make some adjustments to the way that the shape is displayed.
First, you don’t want the shape to be completely opaque, because it will begin to cover the form in the photo that you are trying to extract from, which will quickly begin to hinder your ability to see the appropriate edges clearly and make good decisions about point placement. I typically pull the shapes opacity (or transparency, as Photoshop calls it, which is technically a misnomer) down to around 25%. This gives me just enough opacity to see the area of coverage as I move along, and it gives me plenty of transparency to see the form behind it.
The second adjustment you may want to make is the color of the shape. You can change the color of your layer by double clicking the layer’s preview icon on the left side of the layer in the layers palette (The icon will be a solid color, which will match the current color of your vector shape). This decision is rather subjective, and should be made based upon the predominant colors of your photograph, as well as what personally suits you. If your photo is dark, I suggest changing your shape to a lighter color, and vice versa. There’s also a possibility that your shapes initial color works quite well without any change. The goal here is to increase the visibility of your shape, without increasing its opacity, to aid in the decision making process as we move along.
I’d also like to note that you may want to make your shape completely transparent. You’ll still be able to see the outline of your vector shape clearly as you work with it. Sometimes I choose this option, and it seems to depend solely upon my mood at the moment. If you do choose to do this, then the color of the shape is obviously irrelevant.
Now that we have gotten many of the preliminary considerations out of the way, you may want to start all over. I needed you to get this far so I could discuss the optimal way to configure your shapes appearance. However, we haven’t discussed how to adjust the curvature of your lines as you work, so there’s a good chance that your shape looks a bit questionable right now. No worries; you haven’t done that much work yet. You can safely throw it away and begin again, keeping in mind the display settings that we just discussed.
If instead you decide to continue where you left off, look to see if the line is still visible, and if you can still see the vertices of your vector shape. If so, you can just continue with the pen tool as if you had never stopped. If you can’t see the both the line and the vertices, you can still continue your shape. Just select the layer in the layers palette that your shape is on, click the layer mask preview icon on that layer (the large box to the right of the layer’s preview icon; it’s probably a gray color). This should cause the line on your layer to reappear; if not, click the preview box one more time, and the line should appear. Now select the pen tool and float it over the end of the line until a tiny box symbol (like a vertex) appears by your pen. This symbol tells you that your pen is in the continuation mode; you can click your mouse on the end of the vector line, and you should be starting right from where you left off.
Before you begin creating your shape (or continue, as the case may be), there are a few considerations to make that might save you a significant amount of time. Always remember that you don’t need to be a perfectionist unless you have to. More shortcuts mean less time; less time means more profit. And there’s nothing wrong with taking a shortcut as long as it doesn’t effect the quality of the final design. Ask yourselves these questions:
Both of these considerations can be made with a moderate grain of salt, because when you’ve completed your vector shape and extracted your form, if you find that some flawed edges are visible, or that some mistakes were not lost in the final resize, you can always go back and make adjustments easily, without any really significant loss of time, as you will discover later in this article.
When you begin to draw your shape, you should zoom into your photograph to at least a 400% view. I generally operate at 800%, or even 1600%, which is as far as you can go. Zooming in helps you to see what I call the anti-alias edge. This edge is the area where your form subtly blends with the shapes and colors around it. If you view your photo at 100% or less, the edge of your form probably looks sharp and well-defined (if it doesn’t, this exercise won’t work very well). As you zoom in, that edge will begin to lose some definition, and the more you zoom in the fuzzier the distinction gets between your form and its surroundings. This fuzziness is called anti-aliasing in the technology sect, and it is the very thing that makes your edge look sharp and smooth when you view your photo at its actual size. If there were no fuzziness, the pixelation of your computer monitor would cause your edge to look jagged and rough.
It’s important to understand this edge, because when you extract your final form, Photoshop is going to create its own anti-aliasing to make the edges of your shape crisp, smooth, and easily blendable with a new background. This means that in order to achieve the most realistic final effect, you need to try to keep your lines directly in the middle of the fuzziness, so that the final anti-aliasing matches the original anti-aliasing as closely as possible.
As you click the left mouse button to lay down a new control vertex, try holding the mouse button down and dragging the mouse a bit. You’ll notice two control handles growing from the control vertex. If you continue with your shape by creating another vertex, you’ll also notice that the two lines that go to and from the previous vertex with the control handles, these two lines connect to your previous vertex very smoothly, as if they were one line. If you didn’t hold and drag your mouse, these two lines would connect very sharply, forming a well-defined corner. The property that determines whether this connection is smooth and curved, or sharp and defined, is called *tangency*. If the connection is smooth and curved, the tangency is said to be continuous, and if it is sharp and defined, like a corner, the tangency is said to be broken.
The workflow for controlling this property is very intuitive and seamless as you are creating your shape; it doesn’t even require that you change your tool. At any time, you can go back to any vertex in your shape and alter the appearance of the connection there by clicking it with the Alt key held down, either by alt-clicking a vertex at a smooth connection and letting go quickly, which will break the tangency. You’ll notice when you do this, that your pen is actually controlling one of the control handles, which you can move around to control the way that the curve looks. You’ll also notice that the the other handle on the same vertex (there will always be either two or none), will remain on the opposite side of the vertex, no matter where you move the handle you’re holding. This is another sign of continuous tangency.
Another way of breaking tangency is to alt-click and drag one of the handles. This will allow you to move the handle you have selected without effecting the other handle. This will give you a sharp corner where the two lines connect, but the two lines that connect there will have a curvature of their own. If a line connects two vertices and neither of those vertices have control handles, that line will have no curvature; it will be perfectly straight.
Yeah, that was a real snoozer. The bottom line is that you have a tremendous workflow once you get used to it. Click, hold, and drag to create curves as you go. Click and release to create corners as you go. Alt-click and release a vertex to make curves straighter and turn that vertex into a corner. Alt-click and drag existing vertices to reset and adjust their curviness. Alt-click and drag a handle to break a smooth connection and change the curviness of one side of that connection.
Use this work flow to work your way around your form. Try to stay zoomed in so that the middle of the anti-alias edge is clear to you. Keep your lines in the center of this edge as much as possible. Try to place your points strategically, in the middle of curves and in corners. If you can follow the flow of a section of your form using only two vertices instead of three, this is a good thing. The less vertices you can use to make your shape, the better and cleaner your shape will look when you’re done. Use as many as it takes to be reasonably accurate, and no more.
Once you have completed your form, make sure that you click the first point you made in the shape, to finish and close the vector object.
The next thing to do is zoom out and look for holes. Holes in forms can be very elusive and hard to see in photographs, so look very closely. If you find a hole, use the same techniques and create a new shape to duplicate the form of that hole. This will create a new layer in your layer stack. Do this for all the holes that you find. Once your done, you could combine all the shapes into one layer, and bring these shapes together into a composite form with actual holes, but this is not easy unless you have a bit of experience with the tools. For this lesson, we’ll discuss working with the layers separately, which produces a final product that is just as great.
In the layers palette, find the layer that represents your primary vector shape. While holding down the control key, left-click the preview icon in the layer. This will create a selection area that is exactly the same shape as your vector object.
So what about the holes? Always keep this rule in mind: for every command, operation, or tool in Photoshop, there are often alternate and similar commands, operations, or tools that can be reached by holding down the Alt, Ctrl, or Shift key, or any combination of the three, while performing the command or operation, or while using the tool (or the Opt, Cmd, or Shift key, for Macintosh users). In this particular case, you can hold down the Alt key, in addition to the Ctrl key that you held down a moment earlier, and then click the preview icon on the layer that represents a hole in your final form. This operation will subtract the shape of your hole from the primary selection area that you just created. You can do this with all of your hole shapes if you have more than one.
You should now have a selection area that looks exactly like your final form, holes and all. In your layers palette, select the layer that represents your original photograph. Once you have it selected, simply press Control+J. This is the hot key command for “copy to new layer”, which will extract your final form from the photograph. Click the visibility toggles on your photograph and on the background layer, as well as all the vector layers (the visibility toggle is the eye to the far left of each layer in the layer palette; if you only see a small empty box there, that should mean that the layer’s visibility is turned off, which is what we want). The only layer that should be visible is your final form.
What do you think? Pretty sweet, huh? You can now copy, drag, or place this shape into any other Photoshop document and on top of any other background or layer, with some very pleasing results. Try applying a drop shadow layer style, which will create some nice depth to your layer. This could be a good or bad thing, depending on what your final form is, and what level of realism you’re trying to achieve in the long run.
That’s the best workflow I know of to extract forms from photographs. The truly great part about using vector shapes are their flexibility and non-destructive nature. For example, once you’ve extracted your form, if you’re not happy with the results, you can just delete your final form, turn the visibility of your original photograph layer and your vector layers back on, go back to your vector shapes and make adjustments to the shape using the point adjustment tools, i.e. the white arrow, and the tools that are under the same button with the white arrow, which you can use to manipulate the existing vertices and control handles. You can also use the pen tools to add and subtract vertices, or you can select a vertex with the white arrow, and press the delete key, which will will open your shape back up, at which point you can select your pen tool, click the end of the open line, and add a new series of vertices to your shape. This is a very, very flexible methodology that will never leave you in a corner with no options.