It is currently Fri Jul 26, 2024 5:23 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: layer cannot be selected by its boarders easily?
PostPosted: Wed Oct 30, 2013 1:19 pm  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2011
Posts: 77
GIMP Version: 2.8.4
Operating System: Windows
OS Version: Windows Vista 32bits
GIMP Experience: Beginner Level



I basically can't come up with a built-in way of selecting a layer's boundaries.

How do I create a selection from the position and size of a layer?
Pressing «ctrl»+«a» will select the whole image size, not the layer size.

If we head over the snaping menu, there is no layer boundaries only image boundaries option.

_________________
Using Windows Vista 32 bits, 3GBRAM, Intel core 2 Quad Q6600 2.4Ghz, Radeon HD 3450 graphics card, Lambda Lexicon USB audio interface.


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: layer cannot be selected by its boarders easily?
PostPosted: Wed Oct 30, 2013 2:01 pm  (#2) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
I'm not entirely clear about what you want. Here is an image of a layer with a smaller boundary than the image. The only part of that layer I can select is that area within the layer boundary, either by Alpha to Selection or using the Fuzzy Select tool. :fuzzsel

Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Wed Oct 30, 2013 2:10 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
I wrote the following script about 7 years ago to do this. It adds a command to the Select menu ("Select->Within Layer"). If there is no selection when you run the script, it will select the entire layer. If there is a selection present when you run the script, it will reduce the selection to only the portion of it that intersects with the layer.

http://chiselapp.com/user/saulgoode/rep ... ad9fd70b8d

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 6:21 am  (#4) 
Offline
GimpChat Member

Joined: Sep 13, 2011
Posts: 77
Thanks Saulgoode, I will try it out.

_________________
Using Windows Vista 32 bits, 3GBRAM, Intel core 2 Quad Q6600 2.4Ghz, Radeon HD 3450 graphics card, Lambda Lexicon USB audio interface.


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 8:01 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4759
gasto wrote:
GIMP Version: 2.8.4
Operating System: Windows
OS Version: Windows Vista 32bits
GIMP Experience: Beginner Level



I basically can't come up with a built-in way of selecting a layer's boundaries.

How do I create a selection from the position and size of a layer?
Pressing «ctrl»+«a» will select the whole image size, not the layer size.

If we head over the snaping menu, there is no layer boundaries only image boundaries option.


Foreword: like many IT persons, my assumed motto is "Tell me what you need and I'll show you how you can do without it".

So, in the case at hand I don't see why you would want that (if it's not what you get by "Alpha to selection"). For most purposes (except the use of the Align tool), a layer the size of the canvas and a layer restricted to the bounding rectangle of its non-transparent parts are equivalent... so using the layer boundaries for a selection gives these boundaries an importance they rarely have. So what are you trying to achieve?

_________________
Image


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 9:27 am  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The utility of selecting the boundaries of a layer appears when you switch to a different layer afterward. For example, if you want to crop that other layer to the same size. A couple of other scenarios are shown in the following graphics.

Attachment:
File comment: Background for a text layer
layer-bound2.png
layer-bound2.png [ 31.23 KiB | Viewed 2969 times ]


Attachment:
File comment: Border a layer
layer-bound.png
layer-bound.png [ 75.95 KiB | Viewed 2969 times ]

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 10:14 am  (#7) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 14182
nice explanation and visuals Saul. thanks, I have had that script for a long time but didn't know what to do with it. :oops: :oops:

_________________
Image


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 11:41 am  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4759
saulgoode wrote:
The utility of selecting the boundaries of a layer appears when you switch to a different layer afterward. For example, if you want to crop that other layer to the same size. A couple of other scenarios are shown in the following graphics.

Attachment:
layer-bound2.png


Attachment:
layer-bound.png


Devil's advocate:

1) duplicate the text layer and bucket-fill. But in the general case, the original layer, which is just the text bounding box according to font metrics, is not the best reference for a frame/background (isn't it a bit a tight fit on the sides?).

2) IMHO a rather artificial case... if Wilber is nicely framed in the layer, then the layer has been cropped around it, and this could have been used to also produce the frame.

Now, what is gasto's original problem? :)

_________________
Image


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 12:18 pm  (#9) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
gasto wrote:
I basically can't come up with a built-in way of selecting a layer's boundaries.

How do I create a selection from the position and size of a layer?
Pressing «ctrl»+«a» will select the whole image size, not the layer size.

If we head over the snaping menu, there is no layer boundaries only image boundaries option.
Am I missing something?
Simply selecting or cycling layers in the Layers dialog selects its x, y boundaries ( select all not required, select none is ).

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


Top
 Post subject: Re: layer cannot be selected by its boarders easily?
PostPosted: Thu Oct 31, 2013 5:14 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
On the side of the angels(?!):
ofnuts wrote:
1) duplicate the text layer and bucket-fill.

What if, instead of bucket-filling with a solid color, you wish to highlight the text in another manner? By applying a filter or rendering to the background layer, for example.
ofnuts wrote:
But in the general case, the original layer, which is just the text bounding box according to font metrics, is not the best reference for a frame/background (isn't it a bit a tight fit on the sides?).

It is a repeatable reference based upon the graphical data, and thus amenable to my non-artistic sensibilities. Also, the original layer can be duplicated, auto-cropped, the bounds selected, and the duplicate deleted. This leaves a selection that bounds just the text (works for non-text too), awaiting further processing (growing, rounding, distorting, etc). And while this may seem like a tedious way to obtain such a selection, each of the steps can be assigned to dynamic keyboard shortcuts and the process executed by pressing in sequence the keys (1, 2, 3, 4, as an example).

ofnuts wrote:
2) IMHO a rather artificial case... if Wilber is nicely framed in the layer, then the layer has been cropped around it, and this could have been used to also produce the frame.

Such is not the case if the layer happens to have been imported from a file or otherwise generated as its own entity.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts How to easily install the lastest Gimp 2.99.19 On Windows 10-11

4

No new posts Attachment(s) HN: Draw shape - Create paths draw shapes simultaneously and easily

31

No new posts Attachment(s) Adding a image as a layer, moving layer, and then flattening

2

No new posts How do I script a new white layer to the bottom of the layer stack

7

No new posts Shortcuts to 2.10 documentation re: Layer & Layer-group modes

0


cron

* Login  



Powered by phpBB3 © phpBB Group