GIMP Script-fu

Update of "sg-copy-mask-from-above"
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: ecfbbf052adeb539f6f96d48b041ddafc6e410c5
Page Name:sg-copy-mask-from-above
Date: 2012-02-28 09:28:41
Original User: saul
Next 18b069a3903278303fa64b29f6a6c1cc61201b56
Content
Command:
Copy Mask From Above
Menu:
"<Image>/Layer/Mask/Copy Mask From Above"
"<Image>/Layer/Mask/Copy Mask From Above"
PDB Name:
script-fu-sg-copy-mask-from-above
Download:
sg-copy-mask-from-above.scm (after the page appears, click on the "Download" command)
License:
GPLv2+

Description:

This script copies the layermask from the visible layer directly above the active layer in the layer stack.

The result follows the following rules:

  • If the active layer already has a mask, it will be replaced by the new mask.
  • If the above layer does not have a mask, a grayscale copy of the above layer will be added to the active layer.
  • If there is no visible layer above the active layer, a mask is added initialized from the selection.

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.

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

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.

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.