Paint: Transform a layer or the canvas
paint_transformScale, rotate, flip, or translate one layer, or crop, resize, and trim the whole canvas, to adjust drawings before export.
Instructions
scale | rotate | flip | translate on one layer; crop | resize | trim on the whole canvas. Bilinear resampling; trim shrinks to painted content.
Target the canvas by name (created with paint_canvas) and optionally a layer index. Layers, filters and undo work the same for every drawing tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| axis | No | horizontal | |
| mode | Yes | ||
| layer | No | Target layer index; defaults to the active layer (see paint_canvas). | |
| width | No | ||
| anchor | No | center | |
| canvas | Yes | Canvas name. Letters, digits, space, dot, dash, plus; the .png/.paint suffix may be included or omitted. | |
| factor | No | scale multiplier | |
| height | No | ||
| degrees | No | ||
| preview | No | Image reply: auto/thumb = downscaled picture back into the result, full = unpixelated, none = text only | |
| background | No | Bottom-layer colour when growing the canvas | |
| preview_size | No | Longest edge of the returned thumbnail |