Thursday, September 9, 2010

PhotoShop Tutorial: Masking

One of the hardest things to do in PhotoShop and the most sought-after skill is masking, or cutting out an element in such a realistic manner that you can place it into another picture and it looks as though it belongs.  This is a skill I have worked on for years and one I can hardly say I've perfected, although I have learned a few tricks along the way.

Part of my trouble is that I have to constantly compensate so I can see enough detail.  For this reason, I've developed a unique method that I've officially nicknamed The Tedious Method.  You'll see why.  But it works.

Please note that I'm almost entirely self-taught in PhotoShop.  I've learned by trial and error, so if I am doing something in 58 steps that could be done in four, feel free to let me know in the comments!



For purposes of this tutorial I want to take Little Mister from this photo where he's walking along the beach with his stick...



...and transplant him to this photo of Curly. Because the backgrounds came from the same place, it makes the swap one step easier. If you get a good enough mask, however, you can put your subject against any background and they will look natural.

Ok, let's get started.



I opened both photos up in PhotoShop.  One of the first problems, of course, is the difference in light and exposure in each photo.  The one of Little Mister is quite a bit darker than the one of Curly.



This one needs some color adjustment.  The red on her shirt is a bit on the purple side.  But we'll get to that later.



The first thing I did was to make a couple of extra layers.  I learned long ago that you want to keep an unaltered layer on the bottom and never, never, never save over your original.  It's too easy to go too far or to mess things up and it's nice to be able to start over.



On the layer I'll be using as my work palette, I used the Image>Adjustments>Exposure sliders to brighten the pic of Mister.  I also used the Image>Adjustments>Brightness/Contrast to brighten the pic and raise the contrast a bit.  It doesn't match yet, but it's closer.



I ran the Image>Auto Tone, Auto Contrast and Auto Color on the one of Curly, just to see if it helped match the two a little better.  It did raise the contrast a bit and that helped.  One of the most important things to do when combining two different photos is to match the light and color on each subject or it's a dead giveaway that the pic has been altered.



Next I inserted a colored layer under the working layer on the pic of Mister.  I did it quickly by copying the background layer, pasting it in between the background and the working layer, selecting the whole layer with a Ctrl-A, deleting the image part of the layer and then painting the layer bright red with the paint bucket.

The reason I do this is to give me a solid, contrasting color to work against.  I can see how crisp my edges are and see if I have any misses or "halos."



Back to my working layer of Little Mister.  I'm ready to begin masking.  Now I could use a layer mask like the pro's do, but I like to just erase the layer itself.  That's why I make extra copies.

On occasion I have used the Magnetic Lasso tool and feathered the selected edge a couple of pixels.  This works too, but I don't feel like I have the kind of control that I have using the eraser tool.  It does take some practice and a steady hand, though, so if you're not comfortable doing that, use a different method.



Now for the eraser tool.  This is a crucial step: selecting the size of the tool and hardness of the edge to be erased.  Every edge needs a different amount of hardness to look natural.  Too crisp and the edge screams, "I'm fake!"  If it's too soft, it looks fuzzy and weird.  It also depends on the size of palette you're using.  For this photo, which is about 2,500 pixels wide, I used for the most part a 17 pixel eraser.  The hardness was about 25% for the edges of his jacket, where I started.

Another thing I do is to zoom in to about 200%.  The edge needs to be clearly defined. 



Then comes the tedious part.  I follow the edge of his sleeve and hand, being absolutely careful not to leave any part of the background to "glow" along the edge but also careful not to erase into his sleeve and change the shape of the edge.



Continuing up the edge of his stick.  I used a slightly harder edge for this, maybe 20% hardness.  A note on the edge hardness: if you use a smaller radius of tool, like to get into a small space, you need a softer edge in order to match what you're doing, because the feathering on the edge will be less and the edge looks harder after you mask it.



Now we get to a tricky part, the background showing behind his glasses.  The color of the rocks blends in with the highlights on the lop of the lens, so I'm going to have to fake it when I go in there and erase out the background.



Masking hair is probably the hardest thing anyone ever tries to do in PhotoShop.  I actually have a plug-in called Mask-Pro to do hair, but in cases like this where the line of the hair is still fairly smooth, I can do it with the tools I have.  I used a larger radius and quite a bit softer edge, maybe 65%.  The key is removing ALL of the background color so you don't get a glowing halo around his head.  I've found that letting the edges of the hair get a little bit transparent works better than leaving any of the light background color.



The first pass is done.  I erased all the way around my subject and the edges are a natural feather for each texture.



Now I set my eraser to a larger size, say 100 pixels and 100% hardness.  Then I start erasing more of the material near the subject, being careful, of course, not to touch the edge of the subject itself.



Once I have a larger area cleared, I can use the lasso tool, select the subject loosely, do an inverse select (found if you right-click the selected area) and delete the rest of the unwanted background.



Now I have just the subject I want.  I select all on that working layer, copy using Ctrl-C...



...and paste him in as a new layer on the second photo.  Obviously he looks grossly out of place here.  But a few tricks will make him drop into this scene as if the photo was taken with him in it.

The first problem is that the angle of the first photo had him walking down a fairly steep hill and his feet are pointed downward.  I'll solve this by moving him so his feet are hidden below the bottom edge of the picture.  He needs to be in the extreme foreground anyway because he is larger than Curly.  If I wanted to place him back nearer to her. I would re-size him to match her size.



Looking back at the original picture, an important detail is his shadow.  A shadow can make all the difference in how natural a subject looks.  For this I observed the size, shape and location of the shadow in order to recreate it on the other photo.



Using the Burn tool, I painted the rocks darker.  I had to be sure to select the appropriate layer, but once I was done, his shadow looks as if it's always been there.



The last thing I did was to fuss a little bit more with the color on the photo of Curly.  The red in her jacket still looked too blue to me so I used Image>Adjustments>Hue/Saturation to slide a little more yellow into the photo and to raise the saturation a bit, which makes the colors pop.



Here's the finished photo. Curly and Mister exploring together, which they actually were doing, but not in an easily photographed way. I use this technique every year on our family photos to replace the one kid who has his eyes closed with another shot so everyone is smiling. It's nice to only snap ten different takes, secure in the knowledge that I can cobble together the best smile on everyone in post-production. This results in less pressure on my family to get the perfect picture in one shot.

Happy PhotoShopping!

No comments:

Post a Comment