Extracting subject out of background!
I'm just wondering what is the best method to extract a subject (a person with lots of hair) out of the background. I know of a way to extract any subject. However, I'm having a hard time extracting a model with hair blowing in the wind out of the background. Please advise on how would you go about doing this. Thank you very much!
You'll probably get 20 different solutions to this problem.
It sounds like this might be a job for Photoshop and the Magic Wand tool.
Generally, for making a sharp, professional mask..
-Duplicate and delete the Background Layer.
-Use the Freeform Pen tool to create a precise outline of the subject (make sure to close the path at the end of the operation by waiting for the Pen cursor to show the circle icon when releasing the Pen as the end of your path reaches the start point).
-Go to the Paths palette and Save Path.
-Return to the Layers palette, select the subject layer (with the path still selected) and click Layer/Vector Mask/Current Path. Delete the Shape Layer and the saved Path 1 layer.
-Save As: TIFF, Layered, LZW compression.
This creates an easily tweakable vector mask.
Compound paths can be drawn into the vector mask with the Freeform Pen Tool, in the Paths palette.
However, if your subjects hair requires softer edges you'll probably need to experiment with Magic Wand selections. You can duplicate your subject layer as many times as you need to achieve different Wand selection results, than merge the good stuff, toss the bad stuff. You'll be adjusting, among other tweaks, Magic Wand Tolerance, and Select/Modify (to feather the selection).
NOTE: You can also use Make Selection in the Paths palette to generate a live selection from a vector path.
You can also make wand selections in the Channels palette, on an individual color channel. There, when looking at the separated channels, you'll notice differences in contrast that may help to achieve better/more accurate selection results.
Hope this comes close to answering your question. : )
Again, there are a bunch of solutions to this problem. Hair Masking is a popular subject and you should be able to find many articles on it.
Thanks for your detail reply!
I'm aware that there are many ways to achieve this and to make my job in post easier I shot my subject again an evenly lit green screen and used the magic wand tool to take out the background. Unfortunately, I don't get great result especially around the hair. Any tips? Thanks!
I'd work with two images. One, using your existing masking technique. The other would be for masking with a feathered selection, for the hair areas. Than combine the appropriate parts of the resulting images.
You can also try using Inner Glow on isolated areas, to help suppress color bleeding.
Are you achieving acceptable results on the non-hair areas? Are your mask edges jaggy. Is the shape natural looking?
Try the other Selection Modifications also, like; Smooth, Contract.
Can you serve the image, so I can see what were talking about?
Vintendo is right, there are many ways to extract a subject from its background. And he is absolutely correct in recommending that you use a layer mask. To remove a subject with semi-transparent edges like the one you've described, here are some methods I use:
1. Experiment with the "Extract" filter (find it under ... "Filters"). Since you have a uniform background you'll probably get good results by using the "force background" tool inside this filter (it looks like an eyedropper, use it to click on your background). You may want to use an image adjustment of some sort beforehand (like levels, curves or saturation) to create higher contrast between the hair and background.
2. Try using Select -> "Color Range..." to make a selection superior to anything you'll be able to make with the magic wand tool. Again, use a copied layer to play around with the image's contrast and color balance beforehand to create better separation between subject and background. You can use the eyedroppers within this tool to add and subtract colors from your selection (one has a "+" next to it, one has a "-"), and you can also play around with the selection's tolerance on the fly. Once you've made your selection, invert it and you've got your mask.
3. Either of the previous two methods may still allow some background color to bleed through. To get rid of the bleed you can create another mask based on the edges of your first mask. Start by loading the layer mask you just made as the current selection (command-click the mask in the layers palate). Then go to Select -> "Modify" -> "Border" and pick a number appropriate for the resolution of the image you're working with (anywhere from 4-10 pixels, usually). This will select what amounts to a thin piping around your subject. Feather this selection. If you know the color of the new background that your subject will be in front of you can place that new background on the top layer, apply the selection as a mask to this layer, then play around with transparency and blending modes until you get a result you like. If you need the subject cutout to transparency, you can use this border selection to simply add or subtract from the layer mask on your primary cutout layer.
I'm aware that this may not make a whole lot of sense as you read it, but give it a try, play around with the tools I've mentioned and eventually you'll get it. If you find yourself pulling your hair out (he he) over all of this you can always spring for a cutout plugin, like the one Corel makes. These are made for problems like yours. Good luck!
(**I learned these tricks from David Blatner and Bruce Fraser's book "Real World Photoshop." No, I have no other relationship with these guys ... I've worked in print production for six years and have experimented with many methods. Theirs are the best I've come across.)
There is a great Russel Brown tutorial (Google Russel Brown because for some reason I can't include the web site) which I think does what you want. It's the very last tut on his page called Advanced Masking.
It sort of summarizes what everybody has said.
Thank you very much, everyone, for your inputs! I was successfully extracting the green background using the color range method. For the area where the hair is transparent, I used clone tool to cover it. Anyways, thanks again everyone!
[sunriseseagull] "I shot my subject again an evenly lit green screen and used the magic wand tool to take out the background."
As long as your subject isn't wearing any green a good way to go would be to duplicate the Red channel (or whichever channel has the greatest contrast between your green background and your foreground) from your image (creating an alpha channel) then use level adjustments on the alpha channel to make the darker background entirely black. Cmd-click (ctrl-click) the alpha channel to make a selection from it, go back to your original image, duplicate it and add a layer mask (Reveal Selection). Then you can use level adjustments while you have the layer mask selected to get the right balance.
If the Green channel has the highest contrast between foreground and background you can still use this technique, only you'd want to move the background to pure white with levels and then invert the alpha channel.