Warning: This is a rather slow plug-in, since it is complex and script based. If there's enough interest, I will consider implementing a fast C version of it.
This tool is a plugin for gimp which allows clean removal of gaps or objects, if these are in front of monotonous background. This background may be gradient like in any way, so it may have slowly changing colors.
The extracted script needs to be placed in the gimp plugins folder. This would usually result in the file structure:
.gimp-2.8/plug-ins/gradientExtrapolate.py
The folder ".gimp-2.8/" can be found in your home directory on linux and in the user's directory of windows.
You will have to restart Gimp to make the plugin available.
The plugin can then be found in the Gimp menu:
Filters > Enhance > Gradient Extrapolation
Select the region you want to have filled. If this is a gap (e.g. pure white and black) then the "Fuzzy select tool" comes in very handy.
Here I have an image of an eagle at sunset:
You can see boundary artefacts from a rotation application. I rotated the original image such that the eagle and the sun are in the center of a golden spiral.
Also, bear with me, for the purpose of demonstration, let's remove the eagle and the dead tree.
This is the result and as you can see, everything blends nicely.
Here is another example of how the gradient extrapolation produces a nice output as compared to naive removal of objects (due to an only very slight background gradient, this might not be notable on every screen):
Here is a toy example (after cutting from a radial gradient):
Applying the gradient filter on this region will ask for options, I selected these:
The result:
Parameter | Explanation |
---|---|
Order of polynomials | The degree of the polynomials which are used for surface fitting. The higher the better but also the more "wavy" or with extreme results. |
Estimation distance | the distance in px around the given selection with will be used for estimating/fitting the polynomials. I.e. this is the input source distance |
sub selection of pixels | to increase the speed of the estimation increase this value. the image will be subsampled every so many pixels in both directions |
increase selection area | quite often boundaries to gaps are smeared or have sharp edges. Also this is used to feather the new values with existing values. |
restore original selection | restore the original selection after the operation has been performed or leave the new, larger selection for further processing |
Post Gaussian size | smooth the newly filled region with a Gaussian (IIR) of that size |