<dl><dt><b>Command:</b> <dd>Copy Mask From
<dt><b>Menu:</b> Mask From Above"</dd>
<dd>"<Layers>/Copy Mask From
<dt><b>PDB Name:</b>
<dt><b>Download:</b> (after the page appears, click on the "Download"
<dt><b>License:</b>

<dt><b>Description:</b> <dd>This script copies the layermask from the visible layer directly above the active layer in the layer stack. The command is available in both the "Layer->Mask" submenu and in the Layers context menu (that appears when you right-click on a layer).

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 has a mask, that mask will be added to the active layer.</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 -- unless the above layer is a text layer, in which case the text is used for the mask.</li>
<li>If there is no visible layer above the active layer, a mask will be added and initialized from the

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 />
</center>

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

<center><img />
</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 />
</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 />
</center>

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