Paint: canvas lifecycle
paint_canvasCreate, open, save, close, and inspect layered paint canvases before drawing. List files and check canvas size, layers, undo history, and pixel stats.
Instructions
Create, list, inspect, open, save or close canvases.
Actions: create {name, width, height, background} new canvas; background is a colour or null for transparent. Layers start as ["background"? , "layer N"]. info {name} size, layers, active index, undo depth, pixel statistics list {} every open canvas open {path} load a .paint / png / jpg / bmp file from the paint root save {name, path?} write the layered .paint document close {name} drop it from memory (files stay on disk) files {} what is on disk in the paint root history {name} undo/redo stack labels
A canvas must be created (or opened) before any drawing tool can be used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | File path for open/save, relative to the paint root unless allowed | |
| width | No | Canvas width in pixels (create) | |
| action | Yes | ||
| canvas | No | Canvas name. Letters, digits, space, dot, dash, plus; the .png/.paint suffix may be included or omitted. | |
| height | No | Canvas height in pixels (create) | |
| preview | No | Image reply: auto/thumb = downscaled picture back into the result, full = unpixelated, none = text only | |
| background | No | Fill colour for the bottom layer, or null for transparent |