I've got a set of pictures of a group of people that were taken on a tripod. Some of the people moved between pictures, and I want to extract a common background so I can combine the backgrounds to reduce noise, and clone people between pictures so that each person's best shot is shown in a common picture. However, I'm having some trouble figuring out how to do this.

My first thought was to compare pairs of images and subtract them from each other, then find a threshold value to create a black/white mask I can multiply each image against. However, for people who didn't move very much, there is just enough similarity that they wind up partially in the mask. There is also the problem that noise and exposure variations between images result in there being a difference between backgrounds which sometimes exceeds any reasonable threshold.

Is there some approach I am missing to extract a background when I have a set of pictures with the same background but differences in foreground objects, i.e. people? I have tagged this question as background removal, but what I really want to do is the opposite.

  • Can you upload one of your images to see what you want to achieve?
    – p2or
    Dec 19, 2014 at 20:01
  • @poor Unfortunately I don't have permission to publish/make public these pics.
    – Michael
    Dec 19, 2014 at 20:03
  • Ok, but picture examples would be nice to understand your issue.
    – p2or
    Dec 19, 2014 at 20:14
  • 1
    Give a look to hugin. See also the tutorials. Dec 19, 2014 at 23:04

1 Answer 1


You could try the "Extract Foreground (Interactive)" script in the latest version of G'MIC.

I've never done something exactly as you describe, but I do a lot with selecting elements and adding them into different pictures.

Make sure your G'MIC version is up to date and:

  1. Open your pictures as layers in GIMP
  2. Select the first image you want to extract a figure from.
  3. Click the "Filters" menu and select "G'MIC"
  4. In the G'MIC popup menu, open the "Contours" section
  5. Select "Extract Foreground [interactive]" from the list
  6. Follow the on-screen directions

This is a new tool to help extract items. You can use it to help define your copy so you can copy and paste people to new layers.

Once you've got the people and the background you want, use the clone tool to fill in the blank spots then merge the people layers into the background.

I hope this helps. Good luck with your project.

  • Thanks for your answer! I am not familiar with G'MIC, it looks interesting and I will get back to here when I have had a chance to try the above steps.
    – Michael
    Dec 30, 2014 at 18:54
  • I discovered it based on comments on GimpChat. I've only touched the edges of its options, but they're pretty amazing. Enjoy.
    – Margaret
    Dec 31, 2014 at 19:45

Your Answer

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

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