You are here

Heal selection (fix to: Smart remove selection)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
smart-remove.scm4.06 KB

A fix to the Filter>Enhance>Smart remove selection... script.

Release notes:

Fixed a bug where strange texture (e.g. sky from the top of the image) instead of surrounding texture was synthesized onto the selection, as reported at this website for the resynthesizer plug-in.

Changed the menu item to "Filter>Enhance>Heal selection..." from "Smart remove selection..." (New menu item name is shorter and more descriptive. It doesn't use the Heal tool, but the effect is nearly the same. Note the filename is the same, only the menu item name is changed, and it still requires the resynthesizer plug-in.)

Changed the pop-up help text.


Copy file smart-remove.scm to the standard place for scripts. See Preferences>Folders>Scripts for the pathnames. In my case, using Linux Ubuntu, I removed the current version at /usr/share/gimp/2.0/scripts/smart-remove.scm and installed the new version at ~/.gimp-2.6/scripts/smart-remove.scm. (It seems strange that Gimp will not use a script from your home folder if there is also one of the same name in the standard installation folder, but it will for a plugin?)

Code License: 
GIMP Version: 
Scripting Engine: 


I have a Windows 6.0 Vista Home Basic 32-bit system and Gimp 2.8.2

I too am having the problem that when I try to remove text from a picture, using the Filter>Enhance>Smart Remove and then the Map>Resynthesizer Old, it is replacing the text with an area from the top of the picture. I downloaded the smart-remove.scm above and replaced the smart remove.scm that was previously in the scripts folder with the new version. However, it did not change the menu item nor did it solve the problem. Can you help me with this problem? Thank you very much.

My e-mail is

If you're using this Windows version...

...just edit this, replacing "plug-in-resynthesizer" with "plug-in-resynthesizer-old," and it should work marvelously.

I'm using Gimp portable in XP
tried even the latest? 0.16 version of resynthesizer

I notice that when i make a selection even with the new script resynthesizer does takes an area from above.
But i noticed more things go wrong its not only that.

If i make a selection use the tool i get something from the top of my picture
Then i perform an undo of this action so the selection stays the same.
Then i move the gimp window that contains the picture
Move it up left / right / up /down..etc
And each time perform a resynthesize + undo then each filling becomes different

This might indicate that the resynthesizer has a wrong reading of screen pixel location and uses the actual main screen of windows (instead of relative coordinates based on where the window is), or something like that. As It shouldn't matter where the screen is located.

The resynthesizer uses the clock for the seed of its random number generator. Therefore, you would expect to get slightly different results each time you use it, even if all other conditions are the same. I think that should be changed.

Are the results are not only slightly different, but "wrong" in some sense? Possibly you are really not using the corrected "Heal selection" script.

There is also a bug where it gives "wrong" results if there is an alpha channel and transparent areas around the selection. Then it seems to heal with black splotches.

I am using Gentoo Linux.
I d/led the resynth source code from this link.
I did make install and it installed everything correctly.
However resynth didn't show up in Filters>Map.
I opened resynth in ~/.gimp-2.6/scripts and saw that it was compiled for 32 bits while my system and the Gimp are 64 bits.
Looking at the Makefile I noticed the first line contained:
CC = g++.
I checked /usr/bin and found a symlink to g++-4.3.4.
I modified the Makefile to:
CC = g++-4.3.4
and reinstalled.This time it showed up in Filters>Map and was compiled 64bit.
I am not very familiar with other Linux distro's but something similar might happen there.
The g++ compiler is used to produce 32bit code for apps that need it.
Thanks bootchk for your smart remove script.

Thanks to your fix, the "heal selection" feature of Resynthesizer (which still uses textures from top of the image without it) does work *fine* under Windows.

Thank to have fixed this script.. Any hope for the other resynthesys script ?

PhotoC, are other resynth scripts broken? As far as I know, the others (Enhance>Smart enlarge, Map>Resynthesizer) are not broken. I am contemplating other scripts built on resynthesizer: 1. Uncrop (see other post this website) 2. a simpler GUI front-end for texture transfer 3. Decay More on 2. The GUI built into Map>Resynthesizer is daunting for new users. It gives full access to the controls for Resynthesizer, but that makes it too hard to learn to do the most common operation, simple texture transfer. More on 3, Decay. If you iterate Resynthesizer on an image without a selection (on the full image) man-made (regularly patterned) stuff slowly disappears. May not be very useful, but interesting, and it might leave artifacts in images. Also interesting because it raises the question whether you can write a plugin that iterates until the user interrupts it. I don't know of any such plugins yet but I know no technical reason why it couldn't be done. I'm thinking you could easily do it in Python using threads. The only outstanding bug I know of is that resynthesizer needs to have its pdb registry fixed (needs recompiling) so that PyGimp plugins can call it. But that is low priority, doesn't affect users. plashless, off banks of noon

Did you wrote some of the scripts you described ? I have not clear 1 ( wich other posts on this side ?) but 2 will be very nice to have ,and 3 something interesting to experiment

I've written a script that uses resynthesizer, to take the repetition out of a pattern. I tried to upload it, but the silly system thinks it is spam. Here is the sample image: The script is here (I couldn't make it a link or the spam filter seems to block the post...): -Rob A>


Subscribe to Comments for "Heal selection (fix to: Smart remove selection)"