Removing an object on a photo with GIMP

Tutorial to remove objects (or people) and restore the portion of the background they hide in a photo with the Resynthesizer plugin.

With Photoshop, it is possible to delete objects in an image automatically, without any design work. You have just to select the object and use the command "fill with the background". The same can be done with The Gimp in fact and for longer (it is not impossible that the same algorithm has been reused).

This plugin "re-synthesizes" the background" and rebuilds it from same elements on the photo. It can thus reconstruct the sky, lawn, or even more complex views, from a sample taken from the image.

First, see the Resynthesizer tutorial to know the purpose of controls.

We will put in practice the commands using the same pictures that the Photoshop demonstration video.

Using Resynthesizer in Script-Fu

1. Load an image

2. Select an area with the lasso

We want to remove the tree on the top left.

3. Click on Script-Fu -> Enhance -> Smart remove selection

This windows is opened. Select a radius and click on OK.

4.Here is the final image

Using the Map -> Resynthesize filter

To choose the sample that reconstructs the background, this command is necessary.

1. Load an image

2. Select a sample

Use the Selection tool to delimit a part of the picture, we choose here a part on bottom right.
Then we made a cut and paste into a new image. There is no need to save it.

3. Select an item to delete

To remove the road, it is delimited with the lasso.

4. Click on : Filter -> Map -> Resynthesize

This window is opened:

For the Texture source, we use the sample taken from the image.
It is also used to Input map.
For Output map, we use the original photo.

5. Here is the final image

Color channels problem

In some cases, you can get the following error message:

The input and output maps must have the same number of color channels.

This is a message from the plugin and it is raised when the photo you want to edit has a different internal format of the image created by The Gimp for the sample.
To remove the message you must:

  1. Select the entire picture (ctrl-a).
  2. Copy (ctrl-c).
  3. Paste as a new picture (shift-ctrl-v).

Then, work on the two images created by The Gimp, the copy of the photo and the sample.