Photography / Masking Tip replacing backgrounds

Started May 12, 2010 | Discussions
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Photography / Masking Tip replacing backgrounds
May 12, 2010

The next time you have a project where you know in advance you are going to replace the background behind the subjects, try this.

Shoot two shots on a tripod. One with the subjects and one with the background only.

In post processing follow these steps:

Layer the background only image over the image with the background and the subjects.
Set the background image only layer (top layer) to difference mode.
Stamp Visible.

Use magic wand (with tolerance set to 2, contiguous off) to click on the Black background.

Type Q to enter Quick Mask to check selection and clean up any bits that should not be part of the selection. (Type Q again to leave Quick Mask Mode)

Duplicate the original image (with the subjects and background) and place on the top layer.
Inverse the Selection.
Add mask to the image layer.
Place new background image under this layer.

Try this procedure with these images.

If you are really, really bored, try extracting the pineapple with your favorite masking program / method. :^)

Let me know if you have any questions.

This is a great technique if you are shooting group shots at a wedding outside and the background is not so great. A little planning will save you lots of time in post.

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Pineapple with new background
In reply to Mike Warren, May 12, 2010

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Reply   Reply with quote   Complain
GDB
GDB
Regular MemberPosts: 383Gear list
Like?
Re: Photography / Masking Tip replacing backgrounds
In reply to Mike Warren, May 12, 2010

Thanks, Mike. I'll have to try this method out. Now, when do I find the time?

Cheers.

Gary

 GDB's gear list:GDB's gear list
Canon EOS 7D Canon EOS 100D Canon EF-S 15-85mm f/3.5-5.6 IS USM Tokina AT-X Pro 11-16mm f/2.8 DX Tamron AF 70-300mm F/4-5.6 Di LD Macro +1 more
Reply   Reply with quote   Complain
aka_den
Regular MemberPosts: 237
Like?
Thanks Mike... I was able to use your images and...
In reply to Mike Warren, May 14, 2010

...Picture Window Pro 5 with the following workflow:
(1) download the OP's 'backgound_only' and 'pineapple-bkg' jpegs.

(2) click on the 'pineapple-bkg' image, open Composite-AbsoluteDifference, set Overlay = the 'background_only' image, click OK.

Creates an 'AbsoluteDifference' image where the background image areas are black with some isolated black in the main subject image areas.

(3) click on the resulting (2) image, open Mask Tool - BrightnessCurve, form, 'lower-left' Apply Add, OK a BrokenLine curve = [0,0], [10,100], [100,100].

Masks the backgound image areas surrounding the main subject with a slight outline edge gradient.

(4) click on the resulting (3) mask image, open the Mask Tool - BrightnessCurve; form and 'lower-left' Apply Add the default [0,0], [100,100] diagonal curve; and then form, 'lower-left' Apply Subtract, OK a BrokenLine curve [0,100], [50,100], [100,0].

Subtracts the black [0%] to 50% toned outline edge gradient from the mask.

(5) click on the resulting (4) mask image, open the Mask Tool - FloodFill; select large background areas [black] as needed to isolate the main subject [white with gray mix]; Invert; OK.

Eliminates the main subject non-white mask image areas inside its outline.

The resulting (5) mask image is sharp edged and will require further preferential feathering and/or blur when used to Composite-Blend the main subject with its new background...

The resulting (5) mask was feathered -2, then +1 and the new background has a 0 to 100% toned colored gradient with 3.5% guassian HSV-V noise, and a 'drop shadow' was added to the main subject...

I am going to have to try this with actual working images. I can see that (1) the background needs to remain static between the two shots; (2) the camera's auto settings need to be switched to manual, so that the background only shot has the same exposure, focus, and aperature as the first shot; (3) main subject shadowing into the background may need to be taken into account; and (4) a rock steady tripod...

...looking forward to some trials and again Mike... thanks!!!

Reply   Reply with quote   Complain
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Re: Photography / Masking Tip replacing backgrounds
In reply to GDB, May 14, 2010

GDB wrote:

Thanks, Mike. I'll have to try this method out. Now, when do I find the time?

Cheers.

Gary

You're welcome. Hope you find some time. Send me any extra you don't need.

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Reply   Reply with quote   Complain
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Re: Thanks Mike... I was able to use your images and...
In reply to aka_den, May 14, 2010

aka_den wrote:

...Picture Window Pro 5 with the following workflow:
(1) download the OP's 'backgound_only' and 'pineapple-bkg' jpegs.

(2) click on the 'pineapple-bkg' image, open Composite-AbsoluteDifference, set Overlay = the 'background_only' image, click OK.

Creates an 'AbsoluteDifference' image where the background image areas are black with some isolated black in the main subject image areas.

(3) click on the resulting (2) image, open Mask Tool - BrightnessCurve, form, 'lower-left' Apply Add, OK a BrokenLine curve = [0,0], [10,100], [100,100].

Masks the backgound image areas surrounding the main subject with a slight outline edge gradient.

(4) click on the resulting (3) mask image, open the Mask Tool - BrightnessCurve; form and 'lower-left' Apply Add the default [0,0], [100,100] diagonal curve; and then form, 'lower-left' Apply Subtract, OK a BrokenLine curve [0,100], [50,100], [100,0].

Subtracts the black [0%] to 50% toned outline edge gradient from the mask.

(5) click on the resulting (4) mask image, open the Mask Tool - FloodFill; select large background areas [black] as needed to isolate the main subject [white with gray mix]; Invert; OK.

Eliminates the main subject non-white mask image areas inside its outline.

The resulting (5) mask image is sharp edged and will require further preferential feathering and/or blur when used to Composite-Blend the main subject with its new background...

The resulting (5) mask was feathered -2, then +1 and the new background has a 0 to 100% toned colored gradient with 3.5% guassian HSV-V noise, and a 'drop shadow' was added to the main subject...

I am going to have to try this with actual working images. I can see that (1) the background needs to remain static between the two shots; (2) the camera's auto settings need to be switched to manual, so that the background only shot has the same exposure, focus, and aperature as the first shot; (3) main subject shadowing into the background may need to be taken into account; and (4) a rock steady tripod...

...looking forward to some trials and again Mike... thanks!!!

Thanks for posting your workflow. I don't use Picture Window Pro, but maybe there are others that do that will find your workflow helpful. Nice result!

I agree with your recommendations setting up the shoot. Probably best to focus and expose based on the subjects first, whether it be people, products or a car, then shoot the background by itself second, with all the same settings and focus.

I think a fun test would be to shoot a pic of a car, then move the car to shoot the scene again. It may be a lot easier to set up a tripod and move the car than it is to extract out a busy background around all the car parts.

Let me know if you try this. I'd like to see your results.

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Reply   Reply with quote   Complain
Tom C
Veteran MemberPosts: 5,488
Like?
Re: Mike.....
In reply to Mike Warren, May 14, 2010

What is Stamp Visible? I have the black background but when I use the magic wand I get white dots that blink on and off.

Mike Warren wrote:

The next time you have a project where you know in advance you are going to replace the background behind the subjects, try this.

Shoot two shots on a tripod. One with the subjects and one with the background only.

In post processing follow these steps:

Layer the background only image over the image with the background and the subjects.
Set the background image only layer (top layer) to difference mode.
Stamp Visible.

Use magic wand (with tolerance set to 2, contiguous off) to click on the Black background.

Type Q to enter Quick Mask to check selection and clean up any bits that should not be part of the selection. (Type Q again to leave Quick Mask Mode)

Duplicate the original image (with the subjects and background) and place on the top layer.
Inverse the Selection.
Add mask to the image layer.
Place new background image under this layer.

Try this procedure with these images.

If you are really, really bored, try extracting the pineapple with your favorite masking program / method. :^)

Let me know if you have any questions.

This is a great technique if you are shooting group shots at a wedding outside and the background is not so great. A little planning will save you lots of time in post.

Mike

-- hide signature --

Tom
When my bones turn to dust,
and if my CD's didn't rust,
future generations will see my photos
and think that I was nuts.

Reply   Reply with quote   Complain
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Re: Mike.....
In reply to Tom C, May 14, 2010

yeah, that is an important part of the procedure.

Stamp visible makes a layer that is the equivalent of flattening the file and pasting the result on the top layer.

Click on the top layer then use these 4-key strokes:
command-option-shift-e for Mac
control-alt-shift-e for PC

You should end up with a new image layer on the top layer.
Now when you use the magic wand, it will make the selection correctly.

Mike

Tom C wrote:

What is Stamp Visible? I have the black background but when I use the magic wand I get white dots that blink on and off.

Mike Warren wrote:

The next time you have a project where you know in advance you are going to replace the background behind the subjects, try this.

Shoot two shots on a tripod. One with the subjects and one with the background only.

In post processing follow these steps:

Layer the background only image over the image with the background and the subjects.
Set the background image only layer (top layer) to difference mode.
Stamp Visible.

Use magic wand (with tolerance set to 2, contiguous off) to click on the Black background.

Type Q to enter Quick Mask to check selection and clean up any bits that should not be part of the selection. (Type Q again to leave Quick Mask Mode)

Duplicate the original image (with the subjects and background) and place on the top layer.
Inverse the Selection.
Add mask to the image layer.
Place new background image under this layer.

Try this procedure with these images.

If you are really, really bored, try extracting the pineapple with your favorite masking program / method. :^)

Let me know if you have any questions.

This is a great technique if you are shooting group shots at a wedding outside and the background is not so great. A little planning will save you lots of time in post.

Mike

-- hide signature --

Tom
When my bones turn to dust,
and if my CD's didn't rust,
future generations will see my photos
and think that I was nuts.

-- hide signature --

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Reply   Reply with quote   Complain
resident
Senior MemberPosts: 1,371Gear list
Like?
Re: Mike.....
In reply to Mike Warren, May 14, 2010

thanks for the tips...will play with it tonight.
never knew about stamp visible either
--
badui bourizk
http://www.studio102.net
http://www.sicilians.com.au

 resident's gear list:resident's gear list
Nikon D800 Nikon D800E Fujifilm X-T1 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +11 more
Reply   Reply with quote   Complain
WineO
Veteran MemberPosts: 4,311
Like?
Works like a Charm
In reply to Mike Warren, May 14, 2010

Thanks Mike it underlines that you use horses for courses with Photoshop. I tried Fluidmask but gave up when I saw the time it would take on this image to get a good selection. I don't think it would be quite as successful with fussy hair extraction but CS5 Refine edge might make it worth trying. I found that if I made a Clipping Mask and pasted the new background into the image I did not need to place it behind the top layer or invert the selection. Saves a few steps but comes to the same thing.
Claude

Reply   Reply with quote   Complain
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Re: Works like a Charm
In reply to WineO, May 14, 2010

WineO wrote:

Thanks Mike it underlines that you use horses for courses with Photoshop. I tried Fluidmask but gave up when I saw the time it would take on this image to get a good selection. I don't think it would be quite as successful with fussy hair extraction but CS5 Refine edge might make it worth trying. I found that if I made a Clipping Mask and pasted the new background into the image I did not need to place it behind the top layer or invert the selection. Saves a few steps but comes to the same thing.
Claude

Thanks for trying the method out Claude. Yes, there are many ways to skin a cat using Photoshop. Your method having the background on the top is good if you want to set the layer mode to darken over a light background for better transition of the edges (like a sky over tree branches). My method having the background below the subject is good for when you want to use layer styles to add a drop shadow or outer edge glow over the background. It just depends on what you planning to do with the image next.

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Reply   Reply with quote   Complain
Tom C
Veteran MemberPosts: 5,488
Like?
Re: Mike.....
In reply to Mike Warren, May 14, 2010

Thanks Mike, good Technique.

-- hide signature --

Tom
When my bones turn to dust,
and if my CD's didn't rust,
future generations will see my photos
and think that I was nuts.

Reply   Reply with quote   Complain
Tom C
Veteran MemberPosts: 5,488
Like?
Re: Mike.....
In reply to Mike Warren, May 14, 2010

Not as good but it works with one photo if the background is all one color. I created a background with gray picking the color closes to the hair and it gives you a rough mask. You have to up the tolerance to 22 and subtract the selections where you don't want them. You can then use refine mask to cleanup the rest.
I only spent about 5 minutes on this.

-- hide signature --

Tom
When my bones turn to dust,
and if my CD's didn't rust,
future generations will see my photos
and think that I was nuts.

Reply   Reply with quote   Complain
Mike Warren
Veteran MemberPosts: 8,487Gear list
Like?
Re: Mike.....
In reply to Tom C, May 14, 2010

Tom C wrote:

Not as good but it works with one photo if the background is all one color. I created a background with gray picking the color closes to the hair and it gives you a rough mask. You have to up the tolerance to 22 and subtract the selections where you don't want them. You can then use refine mask to cleanup the rest.
I only spent about 5 minutes on this.

-- hide signature --

Tom
When my bones turn to dust,
and if my CD's didn't rust,
future generations will see my photos
and think that I was nuts.

Great Job-Looks like you got the concept and technique down!

Mike

 Mike Warren's gear list:Mike Warren's gear list
Nikon Coolpix P7000 Nikon 1 V1 Nikon D800 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Nikkor 24-70mm f/2.8G ED +18 more
Reply   Reply with quote   Complain
vwgn
Senior MemberPosts: 2,106
Like?
Re: Mike.....
In reply to Mike Warren, May 14, 2010

nice trick, i will have to try this out!

Reply   Reply with quote   Complain
joe filer
Senior MemberPosts: 2,934Gear list
Like?
Worked very well, however...
In reply to Mike Warren, May 14, 2010

I think the technique worked very well on the supplied images. In the real world, the layers used to create the difference mode black won't be the same (identical) image. This may make it more difficult to get a pure black for selecting the extraction subject. Taking identical background images with the commotion of a wedding might prove to be difficult.
Still appears to be a potentially useful technique and worth practicing.
--
My 2ยข worth
Joe Filer
Mahomet, IL
http://www.pbase.com/filer
My latest hobby: http://www.pbase.com/filer/longarmquilting

My 60 year still camera history: http://www.pbase.com/filer/image/49099880/original

My wife is proud to participate in the Alzheimer's Quilt Initiative!
http://www.alzquilts.org/

She has met her first $1000 promise for Alzheimer's research and is working on her second $1000. Cheer her on at: http://www.amisimms.com/1000promise.html

 joe filer's gear list:joe filer's gear list
Canon PowerShot G3 Canon EOS 20D Canon EOS 7D Canon EF-S 10-22mm f/3.5-4.5 USM Canon EF-S 18-55mm f/3.5-5.6 +5 more
Reply   Reply with quote   Complain
Ralph Ramirez
Veteran MemberPosts: 6,662
Like?
Re: Photography / Masking Tip replacing backgrounds
In reply to Mike Warren, Oct 3, 2010

Thanks Mike, I tried it using the images you provided. Works very well and quite easy..................Ralph

Mike Warren wrote:

The next time you have a project where you know in advance you are going to replace the background behind the subjects, try this.

Shoot two shots on a tripod. One with the subjects and one with the background only.

In post processing follow these steps:

Layer the background only image over the image with the background and the subjects.
Set the background image only layer (top layer) to difference mode.
Stamp Visible.

Use magic wand (with tolerance set to 2, contiguous off) to click on the Black background.

Type Q to enter Quick Mask to check selection and clean up any bits that should not be part of the selection. (Type Q again to leave Quick Mask Mode)

Duplicate the original image (with the subjects and background) and place on the top layer.
Inverse the Selection.
Add mask to the image layer.
Place new background image under this layer.

Try this procedure with these images.

If you are really, really bored, try extracting the pineapple with your favorite masking program / method. :^)

Let me know if you have any questions.

This is a great technique if you are shooting group shots at a wedding outside and the background is not so great. A little planning will save you lots of time in post.

Mike

Reply   Reply with quote   Complain
Lucy
Forum ProPosts: 30,847
Like?
I think this is what I was looking for....
In reply to Mike Warren, Jul 9, 2011

I started a thread about how to cut out a flower from the background, make it into a layer and then bevel it and overlay the original.

I'll give this method a try.....THANK YOU!
--
Lucy

E- 510, 40- 150, 14- 54, 70-300 and ZD 35 Macro lenses, and UZI Owner with B-Macro lens
http://www.pbase.com/lucy
FCAS Member #98, Oly Division
'Photography is the art of seeing what others do not.'

Reply   Reply with quote   Complain
Keyboard shortcuts:
FForum MMy threads