It is currently Fri Apr 19, 2024 5:48 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Growing Sharp Corners?
PostPosted: Mon Apr 15, 2013 7:11 pm  (#1) 
Offline
New Member
User avatar

Joined: Apr 15, 2013
Posts: 2
I know it's not possible to grow a selection and keep the sharp corners with the normal "Grow Selection" tool, what I want to know is if there is a way around it... No matter what I do I always get round corners!


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Growing Sharp Corners?
PostPosted: Mon Apr 15, 2013 7:37 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
scaling the selection would do it and this will give you your sharp corners as shown

Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Tue Apr 16, 2013 4:00 am, edited 1 time in total.

Top
 Post subject: Re: Growing Sharp Corners?
PostPosted: Mon Apr 15, 2013 7:59 pm  (#3) 
Hi Pyro Hokoma,
Maybe try Selection to Path, Scale Path, Path to Selection...


Top
 Post subject: Re: Growing Sharp Corners?
PostPosted: Mon Apr 15, 2013 8:15 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
Pyro Hokoma wrote:
I know it's not possible to grow a selection and keep the sharp corners with the normal "Grow Selection" tool, what I want to know is if there is a way around it... No matter what I do I always get round corners!

- Selection to path, save selection to channel and Select/none
- On transparent layer, stroke the path with the required line width (twice the required growth). Important: open the "Line style" options and make sure you select the "Miter" join.
- Alpha to selection (you selection become the line you stoked)
- In the Channels, right click the saved selection and "Add to selection"
- You can discard the layer with the stroke.

Edit: unfortunately this doesn't work 100% of the time. This may require some twiddling of the generated path. But when it works it works well :)

_________________
Image


Top
 Post subject: Re: Growing Sharp Corners?
PostPosted: Tue Apr 16, 2013 12:34 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Scaling shapes/pathes/etc. will only work if the shape is regular and centered.

If your selection is not soft, there is a work around also stroking paths that I use that I find a bit simpler than ofnuts' suggestion above...

1) Save the selection to a path.
2) Toggle quickmask mode (Shift Q) Ref: http://docs.gimp.org/en/gimp-image-wind ... utton.html
3) With your foreground white, stroke the path. Set the Line Width to 2x the size you want to grow the selection, Solid colour, cap style: butt, join style: miter, slide miter limit to the max, and check anti-aliasing.
4) Toggle quickmask off.

Your selection will now be "grown".

You can also stroke with black, rather than white to "shrink" the selection by the same fashion.

Here is an example. The yellow was the initial selection, the black is after growing it in this manner, and the grey is after shrinking it in this manner:
Attachment:
qm.jpg
qm.jpg [ 16.92 KiB | Viewed 5607 times ]


A couple of the corners get bollixed up, especially if they are real sharp. Using the advanced selection to path might let you get a cleaner path that would end up working better.

Unfortunately, I know of no way to script this, as it appears that the stroke path using a line is not exposed in the pdb.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Growing Sharp Corners?
PostPosted: Tue Apr 16, 2013 2:28 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
RobA wrote:
Scaling shapes/pathes/etc. will only work if the shape is regular and centered.

If your selection is not soft, there is a work around also stroking paths that I use that I find a bit simpler than ofnuts' suggestion above...

1) Save the selection to a path.
2) Toggle quickmask mode (Shift Q) Ref: http://docs.gimp.org/en/gimp-image-wind ... utton.html
3) With your foreground white, stroke the path. Set the Line Width to 2x the size you want to grow the selection, Solid colour, cap style: butt, join style: miter, slide miter limit to the max, and check anti-aliasing.
4) Toggle quickmask off.

Your selection will now be "grown".

You can also stroke with black, rather than white to "shrink" the selection by the same fashion.

Here is an example. The yellow was the initial selection, the black is after growing it in this manner, and the grey is after shrinking it in this manner:
Attachment:
qm.jpg


A couple of the corners get bollixed up, especially if they are real sharp. Using the advanced selection to path might let you get a cleaner path that would end up working better.

Unfortunately, I know of no way to script this, as it appears that the stroke path using a line is not exposed in the pdb.

-Rob A>

*bows*

Stroking the path on the quickmask... never thought about that...

Yes, not be able to use the stroke-line in a script is sorely missed.

_________________
Image


Top
 Post subject: Re: Growing Sharp Corners?
PostPosted: Thu Apr 25, 2013 6:51 pm  (#7) 
Offline
New Member
User avatar

Joined: Apr 15, 2013
Posts: 2
Thanks for all suggestions!


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) What's the best tool to snip out corners

2

No new posts Attachment(s) sharp outlines

4

No new posts Attachment(s) GEGL Sharp Bevel - A new classic

2



* Login  



Powered by phpBB3 © phpBB Group