Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to take some portrait shots and then replace the background. I don't have a green screen or anything I can use for chroma keying, so I had this idea that I could take a picture of a background, and then take another picture with people in front of it, and then separate the people from the background by doing a "difference" on the two pictures to create the mask.

Both pictures were taken from exactly the same position (using a tripod and a remote shutter release), so that isn't a problem. The problem is that despite having identical exposures, the lighting of the background is slightly different, so when I take the difference there is a lot of values in the range of 0-15 (on a 0-255 scale) making it impossible for Threshold to determine the mask.

Is there another technique I can use, or am I barking up the wrong tree here?

share|improve this question
What sort of quality are you hoping to achieve? – JohnB Dec 23 '12 at 13:20
Good enough to make decent sized prints, e.g. 8x10 – Michael Dec 23 '12 at 21:16
up vote 2 down vote accepted

The obvious suggestion would be to reshoot with a better background. Back when I had to do something like that, I found a plain green bed sheet to work just fine.

However, if you have to work with the shots you've got, one thing you could try would be taking the difference of the two shots (preferably using the "grain extract" layer mode) and using the magic wand tool to select the background. Then add the selection as a layer mask on the original image and, if necessary, hand-edit the mask until it looks good enough.

Also, it may help to apply selective gaussian blur to the two shots before merging them in order to get rid of noise but still retain sharp edges. Remember to use the same blur parameters for both images.

share|improve this answer
Thanks, I'll try that. I have just been shooting test sets, so I can definitely reshoot as much as needed. At some point I may see if I can pick up a green sheet. – Michael Dec 23 '12 at 21:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.