Layer Mask
photopea_layer_maskAdd or delete layer masks to hide parts of a layer without erasing pixels; create reveal-all, hide-all, or selection-based masks, or remove an existing mask.
Instructions
Add or delete a layer mask, which hides parts of a layer without erasing pixels. 'from_selection' shows only the current selection (use make_selection first). Acts on the target layer, or the active layer if omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | 'reveal_all' adds a mask that shows everything, 'hide_all' one that hides everything, 'from_selection' one that shows the selection, 'delete' removes the mask | |
| target | No | Layer name (string) or index (number) |