GIMP Script-fu

Artifact [ecfbbf052a]
Login

Artifact ecfbbf052adeb539f6f96d48b041ddafc6e410c5:

Wiki page [sg-copy-mask-from-above] by saul 2012-02-28 09:28:41.
D 2012-02-28T09:28:41.320
L sg-copy-mask-from-above
U saul
W 2255
<dl><dt><b>Command:</b> <dd>Copy Mask From Above</dd></dt>
<dt><b>Menu:</b> <dd>"<Image>/Layer/Mask/Copy Mask From Above"</dd></dt>
<dd>"<Image>/Layer/Mask/Copy Mask From Above"</dd></dt>
<dt><b>PDB Name:</b> <dd>script-fu-sg-copy-mask-from-above</dd></dt>
<dt><b>Download:</b> <dd>[http://chiselapp.com/user/saulgoode/repository/script-fu/artifact/fc99b852da81c3e97f485fdff8e081e85a674735|sg-copy-mask-from-above.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>This script copies the layermask from the visible layer directly above the active layer in the layer stack. 

The result follows the following rules:
<ul><li>If the active layer already has a mask, it will be replaced by the new mask.</li>
<li>If the above layer does not have a mask, a grayscale copy of the above layer will be added to the active layer.</li>
<li>If there is no visible layer above the active layer, a mask is added initialized from the selection.</li></ul>

Here are some screenshots of the Layers dialog for a few different scenarios. The dialog on right is the result after running the script.

Layer directly above active layer is visible and has a layermask. That mask is added to the active layer.

<center><img src="http://www.kerosenecow.net/data/images/ChiselWIKI/sg-copy-mask-from-above/SScopy-mask0.png" />
</center>

Same as before but here the active layer already has a layermask (this layermask gets replaced by the new one).

<center><img src="http://www.kerosenecow.net/data/images/ChiselWIKI/sg-copy-mask-from-above/SScopy-mask0b.png" />
</center>

Layer directly above active layer is visible but does not have a layermask. A grayscale copy of that layer is added to the active layer.

<center><img src="http://www.kerosenecow.net/data/images/ChiselWIKI/sg-copy-mask-from-above/SScopy-mask1.png" />
</center>


The layer directly above the active layer is hidden and therefore ignored. The mask is created based upon the first visible layer above the active layer.

<center><img src="http://www.kerosenecow.net/data/images/ChiselWIKI/sg-copy-mask-from-above/SScopy-mask1a.png" />
</center>

</dd>
</dt>
</dl>

Z a41f9d4e51dd735a1bcf564ae25f3480