photoshop_create_clipping_mask
Create a clipping mask to restrict a layer's visibility to the opaque pixels of the layer directly beneath it. Ideal for clipping an image or effect to a shape below.
Instructions
Create a clipping mask on the active layer (or a named layer).
Users often say: clip to layer below, clipping mask, clip this layer, mask to shape below.
Use when: the active layer should be visible only where the layer directly below it has opaque pixels. Do NOT use when: the layer is already clipped — returns success with already_clipping. Do NOT use when: the layer is the bottom-most layer — there is no base layer to clip into.
Returns: JSON { ok, summary, details: { layer_name, is_clipping, already_clipping? } }. Preconditions: active document; target layer must sit directly above the base layer below it in the same group/stack. Side effects: one history step (groupEvent).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer_name | No | Optional exact layer name (recursive search). Default: active layer. | |
| document_id | No | Optional Photoshop document id from photoshop_get_state / photoshop_list_documents. When set, the tool activates that document before running so a UI tab switch cannot retarget the edit. |