Blurring or Replacing a Background in CS3 or CS4
pathfinder
Super Moderators Posts: 14,708 moderator
A topic that comes up frequently is how to blur or replace a background, or a sky.
Not stated but implied also, is easily, quickly, seamlessly, and undetectable.
I'll bet we all have at least one image which might be improved by an alteration, or blurring, or replacement of a background.
With older versions of Photoshop, the Pen tool was probably the first choice of highly experienced Photoshop wizards, along with a little supplemental use of the magic wand, or the color select tool, or the magnetic lasso. Each of these are fine tools, and worth learning to use properly, but none, alone, will meet the four criteria listed above - easy, quick, seamless, and not detectable. The Pen Tool is the most powerful, but not the easiest tool in the box for beginners to use. Some would call the Pen tool an acquired taste.
For selecting an organic, highly multicolored subject like this tree branch ( courtesy of rutt ), I previously felt that the Extract tool was the most useful tool for selecting an irregular shaped, multi colored subject from a colorful, irregular background as discussed in this thread started by rutt a couple years back.
http://www.dgrin.com/showthread.php?t=1011
With the advent of CS3, and now, CS4, I rarely use the Extract Tool. The Quick Select tool has become my tool of choice for most selections that Color Select or Quick Mask does not handle quickly and easily. Especially those irregular, multi colored shapes such as tree branches, or irregular horizons to allow sky replacements.
The first step is ctrl-J( cmd-J on the mac) to duplicate the background layer, and then click on the upper layer in the palette to select it to work on.
The Quick Select tool is called by the W key, that also calls the Magic Wand, but is much more intelligent. The Quick Select tool looks for Edges, whether they are color or shape or texture, and this behavior is very useful. (The Quick Select tool requires an up to date processor and computer for the edge finding algorithms require some significant computer power - for example, it does not work well with PowerPC macs, but much better with dual Intel processor Macs. I suspect that single processor PC users will not find the QS tool a delight to use either.)
After opening an image in PS and duplicating the background layer, I start with a fairly large soft brush in the Quick Select mode, if the object stands out fairly clearly from its surround, and quickly paint over the desired area watching the 'marching ants' appear as I work. I prefer to have my history palette set up to allow at least 60 steps backwards in my preference settings in Photoshop today, so if I go too far, I can quickly step back one step and resume working without losing what I have done.
If I find my marching ants have extended beyond what I wish to select, I reduce the size of my Quick Select tool by about 25% ( by hitting the left bracket key [ ), and then hold down the Option key, and begin painting the area I do NOT wish to select, fairly close to the desired border, and watch the marching ants begin to line up right along the desired border. Sometimes with complex selections, like Rutt's brown ( which a hue of red ) branch in front of the red brick building, I have to go back over what I originally selected again with an even smaller brush to really get the proper final selection. This was most true in deselecting the area surrounded by the branches at the far right of the twig...When you are finally done with your selection it should look like this
After selecting the tree branch, refine the selection with the Refine Edges command. The parameters of the Refine Edges command vary a bit depending on the size and resolution of the image file, but for this one the following values seemed to work best for this image.
The selection looked like this with the preview selection in normal color and the excluded areas in black ( try clicking each of the icons at the bottom of the Refine Edges dialogue box to see what they do and how I got this image )
Sometimes at this stage you can see areas that you failed to select, or selected too much of, and then you need to go back again, and refine your selection further with the Quick Select tool, or another selection tool like the Magnetic Lasso or whatever you are most comfortable with - I usually just go back and use the QS tool again with a smaller diameter brush.
Now that the selection is outlined in 'marching ants' it can be saved so we do not have to do it again by typing Select > Save Selection and filling out the dialogue box to save the selection as an alpha channel
Clicking on your Channels palette, it should look like this
GO back to the Layers palette, and duplicate the selection ( ctrl-J )so we have three layers - the background layer, the selected layer, and the duplicate of the selected area on top.
Now turn off the upper layer, by clicking on the top eyeball ( the eyeball disappears ), and you will only see the lower two layers. Use a Gaussian Blur of about 30 pixels and you will see this,( because the sharply outlined selection on the top layer is currently not visible because we turned it off by clicking on the eyeball).
Click on the eyeball on the upper layer in the layer palette to turn back on the upper layer and you see this!!
One way to call even further attention to the branch, and not the background, is a done with Curves, and Hues and Saturation, to dial back the backgrounds intensity and to direct the viewers attention to the branch for a final image more like this
and a final layers palette like this
One one understands this procedure, replacing skies or backgrounds becomes a very easy procedure.
CTRL-J to dupe your background layer.
Select the sky ( or the background for rutts branch by inverting the selection of the branch selected earlier ) and clone in the new sky from another image into the selected background area to achieve this
The Quick Selection tool and the Refine Edges command can generate selections with sharp or smooth borders and no selection haloes when blurring the background.
Happy New Year!!
So lets see you post some images here with your before and after shots, so we can all judge how well you pulled it off.
Not stated but implied also, is easily, quickly, seamlessly, and undetectable.
I'll bet we all have at least one image which might be improved by an alteration, or blurring, or replacement of a background.
With older versions of Photoshop, the Pen tool was probably the first choice of highly experienced Photoshop wizards, along with a little supplemental use of the magic wand, or the color select tool, or the magnetic lasso. Each of these are fine tools, and worth learning to use properly, but none, alone, will meet the four criteria listed above - easy, quick, seamless, and not detectable. The Pen Tool is the most powerful, but not the easiest tool in the box for beginners to use. Some would call the Pen tool an acquired taste.
For selecting an organic, highly multicolored subject like this tree branch ( courtesy of rutt ), I previously felt that the Extract tool was the most useful tool for selecting an irregular shaped, multi colored subject from a colorful, irregular background as discussed in this thread started by rutt a couple years back.
http://www.dgrin.com/showthread.php?t=1011
With the advent of CS3, and now, CS4, I rarely use the Extract Tool. The Quick Select tool has become my tool of choice for most selections that Color Select or Quick Mask does not handle quickly and easily. Especially those irregular, multi colored shapes such as tree branches, or irregular horizons to allow sky replacements.
The first step is ctrl-J( cmd-J on the mac) to duplicate the background layer, and then click on the upper layer in the palette to select it to work on.
The Quick Select tool is called by the W key, that also calls the Magic Wand, but is much more intelligent. The Quick Select tool looks for Edges, whether they are color or shape or texture, and this behavior is very useful. (The Quick Select tool requires an up to date processor and computer for the edge finding algorithms require some significant computer power - for example, it does not work well with PowerPC macs, but much better with dual Intel processor Macs. I suspect that single processor PC users will not find the QS tool a delight to use either.)
After opening an image in PS and duplicating the background layer, I start with a fairly large soft brush in the Quick Select mode, if the object stands out fairly clearly from its surround, and quickly paint over the desired area watching the 'marching ants' appear as I work. I prefer to have my history palette set up to allow at least 60 steps backwards in my preference settings in Photoshop today, so if I go too far, I can quickly step back one step and resume working without losing what I have done.
If I find my marching ants have extended beyond what I wish to select, I reduce the size of my Quick Select tool by about 25% ( by hitting the left bracket key [ ), and then hold down the Option key, and begin painting the area I do NOT wish to select, fairly close to the desired border, and watch the marching ants begin to line up right along the desired border. Sometimes with complex selections, like Rutt's brown ( which a hue of red ) branch in front of the red brick building, I have to go back over what I originally selected again with an even smaller brush to really get the proper final selection. This was most true in deselecting the area surrounded by the branches at the far right of the twig...When you are finally done with your selection it should look like this
After selecting the tree branch, refine the selection with the Refine Edges command. The parameters of the Refine Edges command vary a bit depending on the size and resolution of the image file, but for this one the following values seemed to work best for this image.
The selection looked like this with the preview selection in normal color and the excluded areas in black ( try clicking each of the icons at the bottom of the Refine Edges dialogue box to see what they do and how I got this image )
Sometimes at this stage you can see areas that you failed to select, or selected too much of, and then you need to go back again, and refine your selection further with the Quick Select tool, or another selection tool like the Magnetic Lasso or whatever you are most comfortable with - I usually just go back and use the QS tool again with a smaller diameter brush.
Now that the selection is outlined in 'marching ants' it can be saved so we do not have to do it again by typing Select > Save Selection and filling out the dialogue box to save the selection as an alpha channel
Clicking on your Channels palette, it should look like this
GO back to the Layers palette, and duplicate the selection ( ctrl-J )so we have three layers - the background layer, the selected layer, and the duplicate of the selected area on top.
Now turn off the upper layer, by clicking on the top eyeball ( the eyeball disappears ), and you will only see the lower two layers. Use a Gaussian Blur of about 30 pixels and you will see this,( because the sharply outlined selection on the top layer is currently not visible because we turned it off by clicking on the eyeball).
Click on the eyeball on the upper layer in the layer palette to turn back on the upper layer and you see this!!
One way to call even further attention to the branch, and not the background, is a done with Curves, and Hues and Saturation, to dial back the backgrounds intensity and to direct the viewers attention to the branch for a final image more like this
and a final layers palette like this
One one understands this procedure, replacing skies or backgrounds becomes a very easy procedure.
CTRL-J to dupe your background layer.
Select the sky ( or the background for rutts branch by inverting the selection of the branch selected earlier ) and clone in the new sky from another image into the selected background area to achieve this
The Quick Selection tool and the Refine Edges command can generate selections with sharp or smooth borders and no selection haloes when blurring the background.
Happy New Year!!
So lets see you post some images here with your before and after shots, so we can all judge how well you pulled it off.
Pathfinder - www.pathfinder.smugmug.com
Moderator of the Technique Forum and Finishing School on Dgrin
Moderator of the Technique Forum and Finishing School on Dgrin
0
Comments
All photos are Copyrighted and Registered. Please don't use without permission.
5DSR 16-35 2.8L III 24-70 2.8L II 70-200 2.8L IS II
Would you also consider reloading the selection, contracting the selection by one or two pixels, then inversing the selection and adding a light blur to the selection to better blend the edges of the branch??
Welcome to dgrin, Bigmitch.
I am not sure I fully understand your question. Take my original selection that I saved, reload it, contract the selection 1 or 2 pixels, ( Ok - this far I do understand ), and then invert the selection and blur it ( what kind of blur and how much was not specified. I am not sure I understand why I want to blur the inverted selection though.
Katrina Eisman's book "Masking and Compositing" makes a big deal out of being able to actually SEE your selection as a mask, and that is precisely what I like about the Refine Edges command. For the finest detail in selections with the Quick Select Tool, I will view the image at 100% or even 200% if necessary, and then use the Refine Edges command. One of the icons at the bottom of the Refine edges command will actually show you the mask and the softness of the edges that you are saving.
One other thing that comes up is where you need sharp, precise borders on three sides of a rectangle, and yet on the fourth side need a very soft, diffuse edge. In that instance I will select with the QS tool, hit the Q key to turn on the Quick Mask Mode, so that I can actually SEE the red mask that has been created. At that point with black as your fore ground color, and a very large soft brush in Normal mode, you can paint onto your mask the very soft diffuse margin needed on the single side where a soft mask was needed.
Here is the Refine Edges Dialogue box again
The icon on the lower left with the chain and the blue over black background will display the standard view with the marching ants outlining your selection.
The chain on the red background will display the actual mask itself - my Photoshop is set up so that the red mask covers the area selected.
The chain on the black background will display the selection in color with the non-selected area in black, as I demonstrated above - the twig is displayed ( hence selected) and the area in black is NOT selected - you can see the edges of the selection here also
The chain on the white backgrounds\ will also display the selection against the non-selected white area.
The white chain icon on the black background surrounded by blue, will display the selected area as white surrounded by the totally black non-selected area.
Personally, I prefer to use the chain on the red background, as I can then see the actual mask itself, and examine it carefully to make sure I have everything I want to include, and nothing I do not want.
Click on OK and the selection is finallized. Hit the Q key, and you can then further edit the actual mask itself.
If blurring the edge of your mask will be helpful you can do that there as well.
I do not blur the edges of my masks with a GB ( because I cannot see it in advance), but paint them with a soft brush and can see them as I work along. Different strokes for different folks I guess.
Moderator of the Technique Forum and Finishing School on Dgrin
www.clemensphotography.us
Canon 7D w/BG-E7 Vertical Grip, Canon 50D w/ BG-E2N Vertical Grip, Canon 70-200mm f/2.8L USM, Canon 18-55mm, Canon 580EX II Flash and other goodies.
Ignorance is no excuss, so lets DGrin!
I think that Bigmitch is suggesting a means of introducing a bit of blur on the edge itself. IIRC, Eismann recommends doing this to make some transitions look more natural. But if I understand his method correctly, I think you could get a similar effect by using the feather option.
K Eisman discusses using the Border command at length in her book with CS2, but with CS 3 and CS4 the Refine Edges allows one to accomplish the same thing without the extra step of working solely on the border, doesn't it?
Inverting your selection, and then blurring the inverted selection with a GB does not directly display to me what is happening. I would prefer to see the mask, and then actually work on the mask directly.. One can certainly apply a GB to a mask, and see the result. I guess I just prefer to paint on the mask with a soft brush. I take no credit for doing things this way, other than that is how Marc taught us all in his classes
As with most things in Photoshop., there are usually at least 6 different ways to accomplish tasks. The method I described above just seems to work for me faster and easier than anyway I have tried previously.
I would be delighted to hear how you perform these tasks, as I know compositing is a task you do far better than I, and that you display here on dgrin frequently.
Isn't the feather option essentially the same thing as the Feather value in the Refine Edges command?
Moderator of the Technique Forum and Finishing School on Dgrin
Thanks! Very interesting and helpful discussion.
Depending on the image, I might use the Quick Selection tool or Pen tool for the first, or (rarely) Select Color Range. I took Eismann's advice and dedicated some time to learning the Pen tool, and it was time well spent. For precision work, there's nothing that comes even close. Again, depending on the image, it is sometimes easier to get a clean selection by working on a single channel.
In the second step, I use the Refine Edges command. I haven't had many occasions in which feathering the edge gave me what I was looking for--more often I find that smoothing and expanding the background's border a couple of pixels gives a cleaner result. You can always go back, contract the border and feather if it doesn't. Once again, this is highly specific to the image and the effect you are trying to create.
The last step is really important. Set the view to 300-500% and (with the mask visible) scan the entire border of the selection, making appropriate changes to the mask as you go with a small, soft brush. No matter how careful I have tried to be in the earlier steps, there always seems to be something that needs tweaking.
While all this edge stuff can get a little arcane, it is really just laborious. With enough patience, anyone can get it right. What I find much more difficult in composite work is getting the light right. Inconsistent direction, strength or color temperature don't jump out at the viewer like a badly done mask does, but our cerebral fraud detectors are very sensitive to subtle differences. The key here is to keep it in mind when shooting the individual components, as it is much harder (and sometimes impossible) to compensate later.
One final point: you should be on the lookout for opportunities to use blending options (Blend If sliders) as an alternative to masking, when there are signifcant color or brightness differences in the pieces you are putting together. Combining blending options with a totally crude mask can give fast and smooth results.
Nothing here that isn't in Katrin Eismann's book, Photoshop Masking and Compositing, which is where I learned most of it.
HTH.
Divamum,
I think you will find you get better control by drawing than by using sliders, at least for anything bigger than, say, five pixels. But as Pathfinder said, the key here is to find the way that's quickest and easiest for you. Lots depends on the individual image and what you are planning to do with the selection, so there's no single answer to your question.
That was my feeling, hence why I've been doing it that way - I've explored the sliders, but even with the selection previewed I find it hard to imagine how that will look *in combination* the other elements in the photo. Useful, for sure, but I'm not sure I've figured out *how* to use it yet!
This is such a great thread - back to lurking while you two discuss this pretty sophisticated stuff! :lurk
Try using some of the different preview options that PF discussed in his second post (the little "chain" icons at the bottom of the Refine Edges dialog).
Oh yeah, opera is sophisticated. This is just ones and zeros.
bwahahahahaha... ! I guess anything feels "easy" when you know how to do it and/or you've been doing it long enough!!! (note to self: singing professionally - 15 years. Using Photoshop - 3 months. I really don't give myself enough credit sometimes!!)
Thanks!!!!
Seriously this method looks terrific and I have another project in the works that I'll definitely use this method on. Thanks a bunch for taking the time to post this tutorial
Jack
(My real name is John but Jack'll do)
Richard, I agree with everything you have said. The Pen tool works very well ( if you know how to drive it ) for sharp, clearly demarcated graphic selections, but much less so for things with softer, less precise margins - at least in my hands. That is why I find the Quick Select tool my most frequently used tool. That was not true of course in CS2.
I do find Color Select can work wonders with skys and large graphic areas of color. You can use the Color Select tool to just select Highlight or Midtones or Shadows also. I find this rather useful as well if I am warming my highlights and cooling my shadows, ala V Versace.
I did not include the use of channels to create masks, as I felt beginners need to walk before they try to fly. Once one truly understands what is going on here, it is easy to add new selections to your mask, whether with selection tools, channels, or whatever is needed. I may add that to the discussion a bit later.
I don't usually review at 500% ( wow!!) but routinely do at 100- 300%, and I agree with you, that I frequently have to go back and tidy up a few bits and pieces along the edge - either adding an omitted area or removing some excess inclusions, but with a small brush the QS tool does this very quickly. For very small changes of just a few pixels, rather than using the brush by clicking and moving it, I will just place it over a few pixel and click once. This helps prevent the QS tool from selecting more than I want. Sometimes the QS tool will want to select a much larger area than needed; when this happens reduce the size of your brush and just click rather than click and drag works more controllable for me.
When I shoot frames for backgrounds ( and I collect skies, brick walls, fall foliage etc ), it is good to document what direction the light was from and what time of day, so that when choosing a new background this information can be utilized as well.
I think the QS tool and the Refine Edges command have to be played with quite a bit to really feel comfortable behind the wheel, so to speak. But they will definitely help beginners get much better results than was previously possible without a lot more work. You can now truly hide the selection line along the horizon if you are patient.
Moderator of the Technique Forum and Finishing School on Dgrin
Somebody (Katrin, perhaps) wrote that the Pen tools works very well for things built by humans, but not for things in nature. She has some very nice exercises in her book for learning how to drive it.
As my example of what can be done with replacing backgrounds or de-emphasizing them - this frame was shot at f8, and the background blurred with Gaussian Blur using the technique described above for the selection. Are the edges of the leaf credible, believable, is the selection detectable? Or am I just all wet?:D
Moderator of the Technique Forum and Finishing School on Dgrin
Selection of the leaf really took no more than a couple minutes
Moderator of the Technique Forum and Finishing School on Dgrin
Looks great to me.
I was working through this, and all is well until after I have created the selection (which saves appropriately in the channels palette).
But when I make my duplicate layer (the 3rd layer, as it were), it is a duplicate layer of the ENTIRE image, and not just the saved area/channel. And nothing changes when I make it invisible.
What I am I missing or doing wrong?
Try New Layer Via Copy (ctl/cmd J).
Thanks. I WAS actually doing that, so I'm still not sure why it didn't work
Weirder still, I opened another image and in that one it worked perfectly! I *think* I may have selected the wrong kind of layer (ie duplicate rather than new layer), but I'ms till not sure - I expect I'll figure it out retroactively at some point when Mystery Command is actually used for something intentionally!
My usual approach would have been to build a mask from one or more channels, and then adjust it. This time the image was B&W, making that next to impossible. I used this approach, pretty much as Pathfinder described in the initial post. It worked very nicely, and it was quick. I did have to make some fine tuning (which I did by painting on and curving the resultant channel for the selection), but you always have to do something of this sort.
Thanks for the description, Pathfinder.
My original text is correct, that after you save your selection, that you want to copy the selection again to create the third layer as you mentioned. You must make sure your selection with the marching ants is still visible and has not been deselected. If you do not see the marching ants you need to load the selection on the 2nd layer, and then type ctrl-j to duplicate your selection.
Try this and see if this isn't what's tripping you up. If you are duping the whole layer a third time, your selection was not active/live.
Is this explanation helpful?
Moderator of the Technique Forum and Finishing School on Dgrin
How do you do this?
Moderator of the People and Go Figure forums
My Smug Site
I think the secret is in your choice of settings in the Refine Edges command - you need to be able to see the mask created in the Refine Edges command as you adjust the parameters in the Refine Edges command. Click on the chain icon at the bottom of the Refine Edges dialogue box with the red background, so that you can see the mask while you set the parameters. You want a smooth edge that just incorporates the fur and nothing else. Try varying the contrast setting and see what you achieve, although I usually leave it at 0.
I used this technique for both of these shots of animals....
G9
40D
This antelope was picked up and moved over the grass to avoid a fenceline it was standing right in front of
40D
Moderator of the Technique Forum and Finishing School on Dgrin
Just saw your response now.
The answer? More embarassing than I can begin to say: the background was a grey sky. The thumbnail for the layer shows small grey squares outside the masked area. It was actually working perfectly, and I managed to mistake one grey for the other since they were more or less exactly the same colour. Oy. rolleyes
Thanks for the follow up!
Here is another attempt at the same image of my dog, Meatball. I am much happier with the results of this one.
What I did different is I paid more attention to the edge selected, went through the refine edges step a few times, each time selecting and deselecting areas I missed or went overboard on. What helped here was to zoom in a lot to make it easier to select the fine details in the fur.
I then used the red background to refine the edge... adjusted the radius a bit and then used the smoothing and feather sliders to get the edge where I wanted it. I also adjusted the expand/contract slider just a little bit.
Then I inverted the selection, added a fill layer in black, added another desaturated layer to convert to B&W and lastly added a warming filter.
What do you think?
Original Image:
Moderator of the People and Go Figure forums
My Smug Site