You are here

Heal path, heal wires, scratches in images

Prokoudine suggested there ought to be way to heal wires (or a scratch or a linear or curved feature) in images by healing a path drawn along the wire.

My first thought was:
Select>From Path
Select>Grow
Filter>Heal selection

But apparently select from path won't select a path that isn't closed (a path that starts and ends on the same point.) Or else it closes the path for you and then selects inside the closed path, which is not what is wanted in this case. Is there a way to select a one pixel wide bitmap from a path?

Another way? :
Layer>Add alpha
Brush Tool -> hard edged, 20 pixel
Path>Stroke with Eraser, emulate brush dynamics
Filter>Heal transparency
Layer>Remove alpha

But that leaves the context altered, it is a pain to program in the context and alpha save/restore?

Also I wonder, could this be programmed with GIMPscripter?
The first recipe could be (if Select>FromPath worked as needed in this case.)
The second, probably not because GIMPscripter won't let you add an alpha channel conditionally, and so forth.

Its a case where if you know GIMP well, you know these recipes and don't need a specific plugin programmed to do it.

But also, it might work better if the path was healed in segments, instead of all at once. For that, you might want a plugin to iterate over the segments.

Or maybe the suggestion is that you ought to be able to stroke with the heal tool (the resynthesizer?) as you can stroke with the heal tool with context aware fill in PS. See http://www.youtube.com/watch?v=o_dC-FkW4mw

I just use quickmask. To make it easier to see what I'm doing I first select all, then turn on quickmask, then paint black over the scratches with a paintbrush. When done, toggle off quickmask and invert the selection to have the scratches all selected.

Then just run the heal selection script.

But, for fun, I modified the heal selection path to resynth along a path:
http://www.silent9.com/incoming/scripts/resynth_along_path.scm

Create a path (multiple sections OK) then run the script by right-clicking on the path and selecting "Resynth Along Path..."
The first parameter is the width of "stroke" and the second is the bordering region to sample for source texture.

I've tested it by creating a path, stroking it with a line on an image, then running the script against the same path. It should also respect selections limiting the path.

-Rob A>

where i can put this quick mask? just put in plugin?..sorry for my poor english..:D

Quickmask is a mode where you "paint" selections: http://docs.gimp.org/en/gimp-image-window-qmask-button.html

The linked to script is what was initially asked for - a way to run resynthisizer along a path.

-Rob A>

use Quickmask?
I just use quickmask. To make it easier to see what I'm doing I first select all, then turn on quickmask, then paint black over the scratches with a paintbrush. When done, toggle off quickmask and invert the selection to have the scratches all selected.
Then just run the heal selection script.

That works great.


But, for fun, I modified the heal selection path to resynth along a path:
http://ffaat.pointclark.net/incoming/scripts/resynth_along_path.scm
Create a path (multiple sections OK) then run the script by right-clicking on the path and selecting "Resynth Along Path..."
The first parameter is the width of "stroke" and the second is the bordering region to sample for source texture.

Not working. I can see the plugin in the procedure browser but no way when I right click to select "resynth along path"

(edit) I just found it and it works great.

Thanks for sharing it. :)

Subscribe to Comments for "Heal path, heal wires, scratches in images"