Heal selection (fix to: Smart remove selection)

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.

Installation:

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?)

AttachmentSize
smart-remove.scm4.06 KB

Comments

fix for windows

I took the modified script and just remove the last 2 parameters. they are the only ones that do not match with previous script. Removing them it works perfectly in GIMP 2.6.6 for windows.
Procedure:
- Install plugin resynthesizer-for-Windows-0.13b
- Take the modified script from this thread
- change "(plug-in-resynthesizer 1 img layer 0 0 1 workLayerID -1 -1 0.0 0.117 16 500)"
by "(plug-in-resynthesizer 1 img layer 0 0 1 workLayerID -1 -1 0.0 0.117)"
save script in script directory

trouble with fix for windows

I download and installed gimp 2.6.6 to my computer running Windows XP home. It works great. I download resynthesizer 13b unzipped and patched it in. It works but with sky filled into the removed area. So, I downloaded what is called "modified script" in the original post and modified it by removing two arguments per above using notepad+ and replaced original script with my modified version. This broke something because the script no longer appears in my gimp script fu menus. Can somebody provide direction?
Thanks,

Greg

Thank you : works with 2.6 and Windows now

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 a lot !

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

what other resynthesizer scripts broken?

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

other scripts built on resynthesizer:

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 one

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...):

ffaat.pointclark.net/incoming/scripts/batch-pixelize-indexed.scm

-Rob A>

Fill with resynthesized pattern

Cool, thanks.

Your link is to a different script, but its no big deal, anyone can find the correct script in the same directory.

But the one in that directory called resynthesize_pattern_fill.scm
seems to have an error in it.
It only passes 11 params to resynthesizer, needs 13.
At least it doesn't work on my Windows XP, brings up an error message about parameter count.

I think thats a good idea, to provide more front ends to resynthesizer.

I noticed you did not use the "Tile horizontal and vertical" parameters to resynthesizer. I don't understand what situations they are useful for.

Resynthesizer itself is not supposed to add repeating artifacts. My first thought was that your adding noise to the process was not necessary, but I suppose resynthesizer alone would copy the repeating pattern verbatim.

plashless, off banks of noon

the 12th and 13th parameters

I think these correspond to the two new parameters that were added to the resynthesize plugin's dialog. I used the default values (30 and 200 in the 'tweaks' pane of the dialog) and the fill-with-resynth script worked and produced convincing results.

IOW, in the resynth_fill script, find the TWO lines that look like this

(plug-in-resynthesizer RUN-NONINTERACTIVE newImage newLayer 0 0 0 newLayer -1 -1 0 0.05)

and add the missing parameters like this

(plug-in-resynthesizer RUN-NONINTERACTIVE newImage newLayer 0 0 0 newLayer -1 -1 0 0.05 30 200)

HTH

Resynthisizer parameters.

My copy of resynthisizer (the latest windows version from the author's web page) only has 11 parameters.

To get your script working (heal selection) I had to remove two parameters.

What I have figured out with the Tile horizontal and vertical... It only has value if the whole layer is being resynthisized (not a selection). It will then make the image seamless when it runs.

It you are using resynthisizer on a selection, the one to set true is the "fit output to bordering pixels". This will make the selection blend with the areas outside the selection.

Where did you get your windows binary.. It must be a later version...

And thanks for noticing the bad URL. (cut and paste error)

It should be ffaat.pointclark.net/incoming/scripts/resynth_pattern_fill.scm
-Rob A>

windows versions of resynthesizer

I downloaded Gimp from:
gimp.org/windows
which leads you to:
http://gimp-win.sourceforge.net/stable.html
and it includes resynthesizer.

The link on Paul Harrison's site (the author of resynthesizer) is:
http://www.logarithmic.net/pfh-files/resynthesizer/resynthesizer-for-Win...

On the same site, the link to the source is:
http://www.logarithmic.net/pfh-files/resynthesizer/resynthesizer-0.16.ta...

Just judging by the links, the windows version (0.13?) on Paul Harrison's web site is earlier than the windows version (0.16?) that the Gimp site points to.

The Linux resynthesizer (at least with Ubuntu version 8.10) requires 13 parameters.

I think there is another person who is maintaining resynthesizer for Debian (and thence to Ubuntu.)

My main platform is Ubuntu. Insert standard diatribe about versions and platforms here.

plashless, off banks of noon

hmm...

The version on gimp.org/windows definitely does not include Resynthesizer... (GIMP 2.6.6, 32 bits)

So I'm wondering where you found a compiled version of Resynthesizer 0.16??

Get errors too.

Thought I had the latest version from Sourceforge Rob. Getting a few errors but it could be due to the version of resynthesizer I'm using. Could you pass on the link to the author's site (maybe it's on Sourceforge too, but got band practice and won't be able to check for 3 hours). :)

More examples

Here are more examples of this script at work. You can see the patterns on the left have significant periodicity, while those on the right have significantly less.

-Rob A>

What can I say; fantastic.

Better to commit to smaller selections then larger ones, but still. This one's a keeper. Thanks again Rob. :)

Lyle

http://www.imageox.com/image/375783-sample.png

Will download and give it a whirl.

Your a top notch guy Rob. Still use your animated brush Script-fu quite often. :)

Lyle

Credit to bootchk

I didn't fix the script, the credit goes to bootchk.

I just posted up a sample of it working ;)

-Rob A>

screenshots

Do You have some screenshots?

Sample

Here is a result.

I quickmasked off the poles and the fire hydrant then ran it with the default radius. No other retouch.

-Rob A>

resynthesizer sample not perfect

On close inspection you can see that resynthesizer got the firewall on the roof correct, but that it didn't quite get the middle mullion on the window correct. It fools casual glances though.

plashless, off banks of noon