You are here

Is there a plugin to round an edgy selection border ? (screenshots inside)

Hello,

I'm searching for a plugin able to apply a "rounding" effect on an irregular edgy selection, removing angles too sharp, averaging lines... Would you know where to find one ?

To make myself clearer, here are 3 screenshots...

A selection that looks good, but isn't :

If you delete this selection, you discover the selection is irregular, edgy - and ugly.

If the selection had been rounded, it would have looked like that (I spent 2 minutes manually applying the desired effect, sigh):

I know such a filter SHOULD exist, there was one (accessed like that : Selection > Round) in the Gimp 2.?? present in Mandrake 10, years ago, but it disappeared from further gimp releases, unfortunately. I'm searching for a replacement.

Thank you VERY much if you can help with a suggestion, a link, all help will be welcome :)

Regards,
Sabin

I find the best way to do this is to turn the selection to a path (Select > to path) then back to a selection (Select from path). The defaults are pretty good. If you want more control the full selection to path dialog is available by opining the path dialog and shift-click the selection-to-path button at the bottom (but don't get too scared by the options! It freaked the heck out of me the first time...) -Rob A>

Actually, Rob, this is exactly like that I made the 3rd picture, with paths :) But "rounding" the border of a selection can have many uses, so by itself this is worth having its plugin....

feather+ sharpen do not solve? (i always enter in quickmask mode to check problematic selections , in similar cases i blur and sharpen the quickmask ...in quickmask mode is easier control and adapt the result, but i suppose feather+sharpen should give similar results)

Please reply to the appropriate comment in the thread. This will make it easier to follow the thread and subthreads. For example, this topic has several subthreads about various algorithms for rounding a selection, and they should all start as replies to the original comment asking for help. The replies to replies should be under the subthread for the various algorithms.

(With all due respect to Photocomix: I value your replies.)

plashless, off banks of noon

Thanks, I had never seen that dialog before.

But to clarify (since I had to hunt for it), to open the "Selection To Path Advanced Settings" dialog:

1) make a selection (the needed buttons are not enabled unless there is a selection)
2) Choose Windows>Dockable Dialogs>Paths (This brings up the "Paths" window.)
3) Shift-click the iconic button (the third from the right in the row of icons at the bottom of the Path window, looks like a big red dot bracketed with black lines.)

(It is confusing to me that these windows that list objects are called "Docks" in the "Windows>Recently Closed Docks" menu item but "Dockable Dialogs" in the "Windows>Dockable Dialogs" menu item. I guess the Gimp GUI designers are using "Dock" as a short name for "Dockable Dialog" to keep the menu item short?

Also "Windows>Recently Closed Docks>" always has only one menu item in it's submenu? Why have a submenu with only one item?

Also "Windows>Recently Closed Docks>Layers, Channels(etc.) ..." ends in an ellipsis, but there are no more choices to make. IE contradicts the standard GUI meaning of the ellipsis.

Also "Windows>Recently Closed Docks>Layers, Channels(etc.) ..." should be "Windows>Open Foobar" (where Foobar is a better name.) IE it should use a verb "Open". It deserves a better name because it seems to me that is opens a set of dockable dialogs that is not necessarily what is not now open or recently closed. For example, I had the Path dockable dialog already open, and when I chose "Recently Closed(etc)" it opened another Path dockable dialog in one of the tabs of the new window.

Also, "Dock" confuses me. I expected to be able to drag a Dockable Dialog to either the edge of the screen or to the "Layers, Channels(etc)" window and have it stick or turn into a tab.

I realize the above discussion might better be in another forum or thread.

Even if you wanted to script this, I can't find gimp_selection_to_path() in the current documentation for the Gimp programmers library (but maybe I am mistaken.)

plashless, off banks of noon

It is either plug-in-sel2path or plug-in-sel2path-advanced.

-Rob A>

Thanks. Where do I look next time? I gather that this procedure is part of Gimp release, but is a separate plugin, and not documented in the Gimp Library documentation.

I'm thinking now about whether you could access the PDB by the field "menu item" and find out which menu items are plugins. I suppose some menu items are not plugins but simple calls to the Gimp Library.

Segue: maybe there is a way to write a plugin to do visual programming (letting the user choose from a list derived as above from the PDB and from the Gimp Library documentation.) This would help the original request of this thread: "I don't want to learn programming but I want a simple way to concatenate two menu clicks and create my own plugin."

Also thinking whether you can Unregister a plugin and reregister it under the menu item that makes sense to you. IE you could rearrange your menus.

plashless, off banks of noon

bootchk-

That one was a pain to find. I only knew about it because I had worked with it before.

Searching by description rather than name in the PDB browser is a good way to find them.

-Rob A>

Try "Select->Distort". Set the Spread to "0", the Granularity to "1", and the Smoothing to some suitable value (experiment).

I tried this, it seems to work well.

But its just a way to do it, not a plugin. The original request is for a plugin to abstract this way of doing it, so users don't have to remember those parameters. In this case, maybe the plugin should abstract away everything but the Smoothing parameter.

And one problem is that you have to do this (Distort the selection to round it) before the fill or delete. Maybe the original request is not just to round the selection, but to round the fill, which is probably a different operation. A plugin could undo the delete, then round the selection, then redo the delete, but that is rather special case: it only works following a delete. Working with layers would change the nature of this problem too. Its a complex GUI problem. It wouldn't surprise me if this is a rehash of a long-ago discussion that resulted in the removal of the Selection>Round operation !!

plashless, off banks of noon

I know just how to do this. But I can't program plugins. Do the following:

1 Fill selection with white.
2 Remove alpha channel (black background!).
3 Gaussian blur (14px is pretty nice).
4 Colors > Levels. Set the values for the top slider as: 108, 1,141.
5 Color to alpha - black to alpha.
6 alpha to selection

Works like a charm. This was someone else's instructions, changed from video to text by me :P

[strike]I run antialias from Filters/Enhance/Antialias after I fill my selection.[/strike].

I think it would be a good idea to suggest to the GIMP developers to incorporate a better anti-aliasing process into the selections options, it only makes sense.

Addendum:I retried the same steps I took yesterday and got a totally different result, and antialiasing didn't seem to make much difference in the jaggedness of my selection. Using Path, as suggested by Rob, was the only way I could counter the jaggedness "without" making multiple menu choices.

OH MY HECK, you saved me HOURS of painstaking work ending in complete frustration! The distort selection REALLY Works! Thank you so, so much! And I agree, I think there needs to be a script for the smoothing of edges!!

Subscribe to Comments for "Is there a plugin to round an edgy selection border ? (screenshots inside)"