Layer to selection

Why this is not already a menu item I do not know.

Does what it says, makes a selection to match your layer.

AttachmentSize
layer-to-selection.scm1 KB

Comments

Thanks!

I was really surprised this wasn't already in one of the menus, but your script works perfectly for me. Cheers!

You could just use "Alpha to

You could just use "Alpha to Selection" under a layer (right click) and it will give you the same results. Unless your messing with the Alpha layer part of your layer then your plugin would be needed.

Difference?

Is there a difference between this and just select all? -Rob A>

The difference is...

performing a Select->All results in the actual selection channel being the size of the image (not the layer) -- or rather, the white portion of the mask is the image size (all channels are the image size). This means that operations based on the selection are not limited to the dimensions of the layer at the time of the Select->All. It is when the selection is put to use on another layer that the distinction becomes apparent (and often useful). The border of the layer may be the extent of a Select->All when that layer is active, but switching to a different layer will make the newly active layer fully selected. A couple of other examples, growing the selection after a Select->All has no effect whatsoever; yet growing a selection of the layer bounds will create a selection larger than the layer (but never larger than the image). By the same token, shrinking a Select->All on a layer does not result in a selection inside the layer border, but inside the image border. I find that selecting the boundaries of a layer is useful in a great many circumstances. I have my own version which is included in the file below; however, I call the function "Select->Layer Bounds" since you aren't really selecting the layer itself. The script file below adds the following three commands to the Select menu: "Select->Layer Bounds" -- performs the same operation as Kiwibird's "Select->Layer To Selection" "Select->To Layer" -- Creates a new layer which is a duotone version of the selection using the FG and BG colors (default colors result in a grayscale layer that precisely matches the selection channel). "Select->From Drawable" -- Creates a selection from grayscale value ("brightness") of the active layer, layermask, or channel. Some of the functionality of the above commands is now more readily accessible (than it was when they were written), however, they a still worth having around. Especially the ability to select the boundaries of the layer. http://flashingtwelve.brickfilms.com/GIMP/Scripts/layer-select.scm

Ah, nice! I'll have to try

Ah, nice! I'll have to try that script of yours. (Your naming scheme seems to make more sense yeah, I was just going by the idea that the layer "provides" the selection.) Thanks for the good explanation too. I didn't know there were comments here until today, guess I have to tick off somewhere to get email about comments.

The difference is...

A point is not clear for me yet... The layer may be more little of the image size that seems the case described But what happens for the contrary with layer bigger then image size ? the selection will be "cropped" to image size ? In other words the part of the layers that extend out of the image boundaries may be selected ...and selection bigger then the image may be saved and reused ? EDIT i figure out simply can't be selection outside image boundary.. i

Thanks

Thanks SG - the script you provided looks like it would be handy to have. I also appreciate the explanation, as I wasn't aware of that. -Rob A>

Difference?

i cannot imagine how could be a difference

i cannot imagine how could be a difference

Well, lack of imagination ?
Syndicate content