Using GIMP to extract a background from a set of pictures

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.


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.

Source : Link , Question Author : Michael , Answer Author : Margaret

Leave a Comment