GIMP Script-fu

Artifact Content
Login

Artifact c080e0771e7462d20007f6f3a4a340a9d9a3c6f9:

Wiki page [sg-isolate] by saulgoode 2013-05-24 17:25:21.
D 2013-05-24T17:25:21.385
L sg-isolate
P e023aa867d2d7d7f3fa1599e109f6619180355e0
U saulgoode
W 1625
<dl>
<dt><b>Command:</b> <dd>Isolate</dd></dt>
<dt><b>Menu:</b> <dd>"<Image>/Edit/Isolate"</dd></dt>
<dt><b>PDB Name:</b> <dd>script-fu-sg-isolate</dd></dt>
<dt><b>Download:</b> <dd>[http://chiselapp.com/user/saulgoode/repository/script-fu/artifact/44019253cbb72ae74415b72a81700f9bfdd0da7f|sg-isolate.scm] (after the page appears, click on the "Download" command)</dd></dt>
<dt><b>License:</b> <dd>[copyright|GPLv2+]</dd></dt>

<dt><b>Description:</b> <dd>If there is a selection, running this script will result in the contents of the current drawable being deleted everywhere <i>except</i> within the selection. This is basically a convenient substitute for the sequence Select->Invert, Edit->Clear, Select->Invert except that layers without an alpha channel will have one added (resulting in transparency rather than background fill).

In addition, if the currently active drawable is a layermask or a channel, the mask or channel is filled with a grayscale copy of the current selection.

I find using this function after duplicating a layer is often preferable to floating a selection or doing a copy/paste. Floating a selection removes the content from the original layer and can sometimes re-position the copied region. Both floating and copying result in the new layer being placed at the top of the layerstack (whereas duplicating a layer places it directly above the original). Using "Edit->Paste As->New Layer" positions the new layer above the original in the layerstack, but also relocates the new layer to the upper-left corner of the image (which is likewise not often desirable).</dd></dt>
</dl>

Z 3c80a619f5d8a04971ff712273d777d5