0

Is there is any solution is photoshop or any other tools where this scenario works.

If I have two image, one with people standing somewhere and another without people. That means the empty area only. So my question is, is there any tools which consider the background image and the peoples image at the same location and it is able to remove the background from the main image.

In simple words, like chroma keying, we are removing the background considering the background image as a reference.

6
  • This maybe youtube.com/watch?v=-lkBMVYH8Fw
    – Joonas
    Jun 16, 2020 at 10:33
  • See this possibly related question (for GIMP): How to remove background using a photo with only the background gimp others but similar should be possible in Photoshop. The upshot is, it's not very practical.
    – Billy Kerr
    Jun 16, 2020 at 15:28
  • @Joonas let's have for ex. a single person that should be photographed and the background must be removed. Someone can see your idea as a bad joke (= bring him or her to different environments, shoot a photo in every place and fade the background automatically by taking what's the same in all photos).
    – user82991
    Jun 16, 2020 at 20:16
  • @Joonas This is actually removing object from a photo. Like people, cars from an image using many images Jun 17, 2020 at 9:27
  • @SandeepThomas, yes it is.
    – Joonas
    Jun 17, 2020 at 9:35

1 Answer 1

1

You can try to place the images to different layers in Photoshop and let the upper layer have blending mode Difference. That makes black all those pixels which are same in both images. The black area can be selected and used to generate a layer mask for the image which contains the interesting target.

In theory it should be perfect. It will work exactly in an experiment where the target is inserted to the background image in Photoshop without having 2 separate shots of the scene. In practice it's not so easy because the light can be different or the background isn't 100,0000% stable or the camera can have moved. Or the camera simply processes differently different shots with its automatic enhancement methods.

Here's the mentioned artificial experiment. Sharp edged letter A is drawn to a copy of the background layer:

enter image description here

Blending mode difference gives this:

enter image description here

Both layers are duplicated, the duplicates are merged, the result is copied to the layer mask of the image which had got the A. The levels of the mask are just under adjustment with Curves to make everything non-black white and to keep black as black. Curves are used to make smooth transition zone to avoid jagginess:

enter image description here

I guess the target itself far too easily affects the light on the background so much that the difference near the target in the background area is far from zero. That can compensated in the curve adjustment phase if the difference still is less than anything in the target area.

Quick selection tool is extremely clever item in Photoshop. With it you can probably make a good selection from the difference image even if the black area is too far from black. But that's manual tinkering like the bg removal unfortunately often is.

This old case Use empty background image as reference for product cut out is more difficult. The blank background image is a little different than the bg+target image and the difference has much nearly zeros also in the target area. Something was still got extracted.

GIMP has more blending modes than Photoshop. If you can try GIMP try blending mode Grain Extract instead of Difference. It will pick what's different.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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