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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "photopea_layer_mask"
}
}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) |