photoshop_set_layer_opacity
Set the active layer's opacity to an absolute 0–100 value to make it more or less transparent. The number replaces the current opacity, not adds to it.
Instructions
Set the active layer opacity to an absolute 0–100 value. The number replaces the current opacity; it is not added to it.
Use when: the active layer should be more or less transparent. Do NOT use when: the layer should be fully hidden from the stack — use photoshop_set_layer_visibility. Do NOT use when: fading into the background with a mask gradient — use photoshop_recipe_gradient_fade.
Returns: the opacity that was set. Preconditions: active document and active layer. Side effects: opacity only. The same value is idempotent. Reversible with photoshop_undo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| opacity | Yes | Opacity value (0-100) | |
| document_id | Yes | Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call. |