photoshop_flatten_image
Flatten the active document into one Background layer, discarding hidden layers and the remaining layer stack. Use when a single non-editable image is required.
Instructions
Flatten the active document into a single Background layer. Hidden layers are discarded.
Use when: the user explicitly wants one background layer and no remaining layer stack. Do NOT use when: hidden layers should survive — use photoshop_merge_visible_layers. Do NOT use when: layers must stay editable.
Returns: confirmation that the document was flattened. Preconditions: active document. Side effects: destroys every layer, mask, and hidden pixel. photoshop_undo can restore the stack while history still holds it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. |