Switch to full style
Ask all general Gimp related questions here
Post a reply

layer boundary as selection

Wed Oct 18, 2017 11:42 am

GIMP Version: 2.8.14
Operating System: Windows
OS Version: 10
GIMP Experience: Experienced User



dear all,

I am an experienced GIMP user, but there is one problem I can't find an easy solution for. I would like to be able to use the bounderies of a layer as fixed selection. for instance, I have a GIMP file with layers in different sizes and positions. When I press Ctrl-A the boundaries of the active layer are selected. But, then, when I make another layer active, GIMP changes the selection to the bounderies of that other layer. That is not what I want!

as an example, yesterday I had two images of same size. I used the second with blend 'darker' and opacity 60 and shifted a little bit to the right and downward. Then how do I get to the point where the canvas is the intersection of the two layers?

And help would be greatly appreciated!

Henk

Re: layer boundary as selection

Wed Oct 18, 2017 12:34 pm

Nothing very quick that springs to mind.

First thoughts, instead of ctrl-a, use the fuzzy select tool with a large threshold to select all the layer. The threshold maxed out will select everything including transparency.

That selection unlike ctrl-a can go to a channel screenshot https://i.imgur.com/Lm6856h.jpg

Repeat for another layer, another channel https://i.imgur.com/ZXbLxRC.jpg

Now the two channels (selection masks) can be added / subtract / intersect to a combined selection. https://i.imgur.com/80ipLkT.jpg

Re: layer boundary as selection

Wed Oct 18, 2017 12:37 pm

The selection isn't linked to a layer, but to the image (even if actions apply to the intersection of the selection and the active layer). Ctr-A select everything, if you switch layers, you are just looking at the selection somewhere else, so to speak.

if the layer are filled, you can to Layer>transparency>Alpha to selection to get a selection that covers the layer exactly. If you want to crop your image to the intersection of both layers:

* 1st layer: Layer>Transparency alpha to selection
* Select>Save to channel
* 2nd layer: Layer>Transparency alpha to selection
* Open the Channels list, right click on the "Selection Mask copy" and "Intersect with selection"
* Image>Crop to selection

Re: layer boundary as selection

Wed Oct 18, 2017 1:00 pm

Thank you Rich2005 and Ofnuts!

It may not be a quick solution, but via the channels I can at least create the exact selection I want. Much better than trying to pinpoint guides somewhere.

many thanks!

Re: layer boundary as selection

Wed Oct 18, 2017 1:30 pm

I don't know if you need a script. But I created one anyway just for kicks.
It simply rectangle selects your active layer with chosen the operation (Add/Subtract/Replace/Intersect).
https://www.gimplearn.net/viewtopic.php ... f=3&t=1023

Re: layer boundary as selection

Wed Dec 30, 2020 12:29 pm

Hello,

For starters, yes.. i know this is an old thread, however since I was looking for a solution to resize the layer boundary to the content of the layer and not finding any simple solution, I just stopped searching and accepted as is. Than again, every single time I was using GIMP it kept bothering me.. I search again and this thread keeps popping up as top result, yet not giving me a simple and quick solution.

Therefore, I registered just for the purpose of sharing what the simple and quick solution is.. (and I might forget this myself in the future)

Option 1
- Select the specific layer
- Select the Fuzzy select tool
- Select the content of the layer
- Go to "Layer" on the top menu bar
- Select "Crop to selection"

Option 2
- Select the specific layer
- Select all by Ctrl-A on the keyboard
- Select the "Fuzzy select tool"
- Hold the Ctrl-key to set the "Fuzzy select tool" to "subtract"
- Select an empty area of the layer without selecting actual content
- Go to "Layer" on the top menu bar
- Select "Crop to selection"

Option 1 is prone to mistakes, because you actually have to select every single piece of content in that layer. If you miss some part and you crop the layer boundary, these parts are hidden because their outside the layer boundary.

So Option 2 is less prone to mistakes because you avoid having to select every single piece of content. Only the empty space, between all the parts of content, and so I personally prefer this option as apposed to the first.

Good luck
Post a reply