How to Use the Interpolation GIMP Plug-in

To make the plug-in work with the default parameters, all you need to do is to make a small selection (not much wider than around 96 pixels) in an image and then run the plug-in.

This plug-in has a lot of parameters. I don't know if any other plug-in has so many. The defaults should be good for most cases though, so normally you will not have to do much or any tweaking to make the plug-in work for you.

Here is an example image and use case.

Flattening a face

I found this image on flickr and thought it is good for showing what you can do with this plug-in. This may not be the best way to achieve this effect, but it shows how to use the plug in.

original face

This plug-in is good for estimating values of intermediate pixels, based on surroundings. It is designed to fill the selection with a smooth gradient that approaches the colors of the surroundings as it gets closer to them, while following the way that the color and luminosity changes. This way you can remove small objects if they are in front of a smooth background (such as birds in front of a clear sky). A more funny use is to make people's faces... flat.

In this picture, you can easily remove the mouth. Use the lasso tool to make a selection:

selected mouth

Then simply run the filter with the default parameters. The dialog box may seem very complicated, but there are tool-tips for everything and you don't have to change anything in this case. Just click OK.

dialog with default options

The result is this:

face without mouth

Observe that there is no trace of the color of the lips. This is because the filter only uses the surrounding pixels (those that are unselected) in its calculations. It does not simply copy the pixels, but instead uses their relative intensities (the way nearby pixels change from light to dark) to calculate a way to continue this 'gradient'.

Depending on what you want to do exactly, you may want to make the selection narrower or wider, but you should make the selection at least 2 pixels wider than the object you want to remove, if you want to erase it completely. A narrower selection gives this:

face without mouth - narrow selection

It looks like the lips have been replaced by a bulge of skin. This is because of the light-to-dark transition right below the lips in the original image. The filter follows this 'slope', making the lower colors darker than the first image.

Next, the eye:

eye selection

missing eye

Thos looks mostly ok, but the eyebrow will be a little trickier:

eyebrow selection eyebrow removal attempt

As you see, the red color from the paint has 'bled' into the selection. To avoid that, you need to tell the filter to read only from a specific set of pixels (the unpainted skin) and avoid the red. You do that with an "input mask".

First, we save this selection to a channel, because we are going to make a new selection.

eyebrow selection saved

To make our input mask, we make a selection of the skin pixels with the "magic wand" tool:

skin selection

We save this to a channel and we reload our original eyebrow selection. We don't want to put unpainted skin in the part where there should be red-painted skin, so we remove that part of the selection.

After you save a selection to a channel, you must go to the Layers tab and click on the layer that you want to paint on to make it active again. When you create a new channel based on the selection, the channel becomes the "active layer". If you don't do that, then you will be painting on the new channel, instead of the image.

second eyebrow selection

You will have to run the filter normally, instead of selecting "Repeat 'interpolate'", so that you can select the input mask. However, when the dialog is shown, the first available channel is selected as the input mask, so again, you will not have to do anything other than clicking OK when you see that dialog (assuming that the channel with the skin selection is fist on the list). The filter will use the last selection that you saved to a channel, which in our case is the skin selection.

dialog with input mask

Finally, you see that the filter used the correct colors and there is no red in the selection:

eyebrow mostly removed

You can repeat the same procedure with the red eyebrow part, without using the "smudge" or "clone" tools.

eyebrow input mask 2 red-painted part of eyebrow removed

Same procedure exactly for the second eye, but this time we'll remove the eye and the eyebrow in one step.

making input mask for the other eye

removed other eye

By playing around with selections and input masks, we can really turn this face into a mashed potato:

the mashed potato

Another example image

From flickr again:

room with picture

room without picture

This is better than what the "Resynthesize" plug-in would have produced for this image. This shows how different tools are better for different jobs.

For this, you need an input mask that includes the walls (easy to make with the "magic wand" tool) and a window of size 256. The "window" setting is how big an area to read to determine each output pixel. A 256 window means that for each output pixel, there will be a square of up to 513x513 (=263169) samples used to calculate it. Because this is too much calculation, samples can be restricted to a "grid", with the "grid" setting. The grid setting of 8 means to take (and use) samples that are 8 pixels apart from each other, vertically and horizontally. So, for each 8x8 square of input pixels, there will be only 1 sample taken, measuring how colors change near that point (to calculate a "plane" or a "curve"). Therefore, with this setting, the number of samples considered for each output pixel becomes one sixty-fourth of the number of pixels that would have been considered if we had taken samples from each and every pixel. This makes the filter complete its work in one sixty-fourth of the time.

room settings

A 32:1 Window:Grid ratio generally works well. The difference from using a higher ratio for larger image areas will be visible mostly near selection edges. You can trade more time for better results.

Another "Window" setting that is important is the slopes sample window (second "Window" setting). This is the window of nearby pixels that is used for calculating a "plane" or "curve" for each "sample". If you set this high, the interpolated surface will be "smoother" but the edges of the selection will become visible because of the averaging of the pixels. Usually, the best setting for this is just a small window (the default is 2), unless the grid is sparse, in which case it should be at least half as much as the grid setting (this will use a Grid-plus-1-sized square of pixels).