It is currently Thu Mar 28, 2024 10:00 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 16 posts ] 
Author Message
 Post subject: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Mon Apr 20, 2015 3:50 pm  (#1) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Experienced User

List any relevant plug-ins or scripts:
NA

List any ERROR messages you received:
NA



If you make a square selection and grow it, say by 18. The corners will no longer be square, or at a 90° angle to each other. But if I grow the rectangle selection by 1, 18 times it stays square.
What's going on here and is there a way to keep the selection square when growing it?

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Last edited by Wallace on Mon Apr 20, 2015 5:16 pm, edited 1 time in total.

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: Grow Rectangle Selection Not Square?
PostPosted: Mon Apr 20, 2015 3:59 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
Read this Wallace, 4.12. Grow

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Grow Rectangle Selection Not Square?
PostPosted: Mon Apr 20, 2015 4:18 pm  (#3) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
Odinbc wrote:
Read this Wallace, 4.12. Grow

It's odd that I never noticed this.
Gimp documentation says this...Image

But when I use the Rounded Rectangle command with a 0% radius and grow the selection. It's still rounded and not square.
If I grow the selection 1 pixel at a time it remains square.Image

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?
PostPosted: Mon Apr 20, 2015 4:29 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4726
The idea is to use the rounded rectangle after the growth, to "fix" the rounded corners.

_________________
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?
PostPosted: Mon Apr 20, 2015 4:47 pm  (#5) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
ofnuts wrote:
The idea is to use the rounded rectangle after the growth, to "fix" the rounded corners.

That seems kind of backward to me, but I can't get that to work to "fix" the rounded corners caused by growing the selection.Image
Anyone care to demonstrate this "Fix"?

EDIT: Demo not needed...

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Last edited by Wallace on Mon Apr 20, 2015 5:20 pm, edited 1 time in total.

Top
 Post subject: Re: Grow Rectangle Selection Not Square?
PostPosted: Mon Apr 20, 2015 5:13 pm  (#6) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
The “Rounded Rectangle” Script-Fu works to fix the selection after it's grown.
You can access this command from the image menu bar through Select → Rounded Rectangle.
Set it to 0% after growing and no more rounded corners.Image
Thanks you guys, it was under my nose all the time. :oops:

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Mon Apr 20, 2015 5:24 pm  (#7) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
That works but I don't understand why.

It also works if you have a square and you want it rounded, click rounded selection... I set mine to 25 and it left rounded corners

_________________
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Mon Apr 20, 2015 6:42 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
Wallace, To Grow/Shrink (square, rectangle) selections I usually use the Selection tool option, Expand from centre and change Size: w/h. It's the quickest way for me.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Mon Apr 20, 2015 7:12 pm  (#9) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
molly wrote:
That works but I don't understand why.

It also works if you have a square and you want it rounded, click rounded selection... I set mine to 25 and it left rounded corners

I hear ya Molly.
I'm just glad it does work, never mind trying to figure out the why's and how's. :hehe

Odinbc wrote:
Wallace, To Grow/Shrink (square, rectangle) selections I usually use the Selection tool option, Expand from centre and change Size: w/h. It's the quickest way for me.

Yeah I understand. :bigthup
I needed to grow 5 selection at the same time, keeping them square and equal all around, without rounded corners.
I never needed to do this before and it was making me nuts. I also didn't realize that by using the Script-Fu command "Rounded Rectangle". I could fix the corners after the growth.
Thanks! :jumpclap

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Mon Apr 20, 2015 10:33 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
molly wrote:
That works but I don't understand why.

It works because the Rounded Selection script doesn't use the actual selection itself, it uses the boundaries of the selection. You could start with a star-shaped selection, for example, and the script would still produce a (rounded) rectangular result.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Mon Apr 20, 2015 11:15 pm  (#11) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
saulgoode wrote:
molly wrote:
That works but I don't understand why.

It works because the Rounded Selection script doesn't use the actual selection itself, it uses the boundaries of the selection. You could start with a star-shaped selection, for example, and the script would still produce a (rounded) rectangular result.

Why is that?

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Tue Apr 21, 2015 3:31 am  (#12) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Wallace wrote:
saulgoode wrote:
molly wrote:
That works but I don't understand why.

It works because the Rounded Selection script doesn't use the actual selection itself, it uses the boundaries of the selection. You could start with a star-shaped selection, for example, and the script would still produce a (rounded) rectangular result.

Why is that?

Whatever the shape of a selection, and no matter how it was created, there is what is known as a bounding-box which is the smallest rectangle that wholly contains the entire selection.

For example, starting with an irregular selection as shown in blue, the bounding box is as shown in red:
Image
(You can think of the bounding-box as the area that the image or layer would be cropped to if you did a Crop to Selection, because that's basically what it is!)

The Rounded Rectangle script simply creates a new selection which is a rounded-rectangle with the same dimensions as the bounding-box of the current selection, not the actual selection itself. By setting the radius to zero, what you get is simply the entire bounding-box, with no rounded corners!

In this case, you're using the Rounded Rectangle script to "mend" the selection. After growing from a square selection, you get rounded corners; by running the script with radius=0, you get the square corners back again.


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Tue Apr 21, 2015 5:24 am  (#13) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
cool, good explanation.

_________________
Image


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Tue Apr 21, 2015 9:34 am  (#14) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
jontaint2, Isn't the reason for the rounded result (using grow/shrink), it's the point of the tangent angle?

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Tue Apr 21, 2015 9:52 am  (#15) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Odinbc wrote:
jontaint2, Isn't the reason for the rounded result (using grow/shrink), it's the point of the tangent angle?

Not sure what you mean by that, Odin!
In the above example I was merely trying to explain to Molly, Wallace et al why and how the Rounded Rectangle script can "mend" the rounded corners produced by growing a square or rectangular selection, not why those corners became rounded in the first place.


Top
 Post subject: Re: Grow Rectangle Selection Not Square?[SOLVED]
PostPosted: Tue Apr 28, 2015 10:32 am  (#16) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
To add some additional references to the discussion...

This was talked about back in 2012 and also in 2013.

I provided a couple alternatives in each to deal with irregular shapes (first link, stroking selections in quickmask mode) and growing orthagonally (second link - a script I link to: grow directional).

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
Post new topic Reply to topic  [ 16 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Shrink Grow Feather Selection with LIVE PREVIEW

43

No new posts Attachment(s) Use Shrink or Grow by 1 pixel on command

12

No new posts Let a Neural Net help you create the best black rectangle on white

7

No new posts Python rounded rectangle bucket fill problem

1

No new posts Alpha to Selection Help

1



* Login  



Powered by phpBB3 © phpBB Group