Trace a picture
trace_picture
Traces an attached drawing, read for its outline and colours.
- Needs
- Nothing to pick: it works on the whole document.
- In the editor
- File, Picture to keychain…, or a picture attached in the Agent tab: Review shows the trace, every setting as a control.
- Tools tab
- Picture to keychain… starts the editor's own control.
- Agent and MCP
- The chat's agent and MCP clients call
trace_picture, each call one step to undo. Over MCP it also takesproject,editorandrequest_id.
What it does
A photo or scan of a drawing traced here in the browser, never uploaded: the paper told from the ink however it was lit, dust taken out, lines too thin to print thickened, the drawing's shape found at its size (15 to 150 mm on its longest side), and each area its ink encloses read for its colour, the paper's or one of at most a palette's colours (1 to 8, 4 by default: one AMS).
A PNG, JPEG or WebP of up to 20 MiB and 50 megapixels. Review shows the picture, the trace as cleaned and each area's colour; a tap takes an area from its colour to paper, to open, and back. The agent gets measurements and warnings, never the picture.
Inputs
As the agent and MCP clients send them. One left out takes the default its description gives.
| Input | Type | What it is |
|---|---|---|
| picture | string | The picture's id from <pictures>; the last one attached when left out. |
| size | number | The drawing's longest side, in mm. |
| thinnest_line | number | Lines thinner than this are thickened to it; 0 keeps them as drawn, in mm. |
| rotate | one of 0, 90, 180, 270 | A clockwise turn of the picture, in degrees. |
| crop | see the description | "fit" to fit the drawing found, or the part to keep as {left, top, right, bottom}, each in % of the picture from its left or top edge.Not in the Tools tab's form. |
| background | one of "auto", "light", "dark" | Light paper with dark ink, or the other way round. |
| even_lighting | boolean | Divide out uneven light, such as a shadow. Turn off for a drawing coloured in solid. |
| threshold | number or null | How dark, from 2 to 98 % of white, a pixel must be to count as ink; null is automatic. |
| remove_specks | number | Ink pieces smaller across than this are dust, in mm. |
| close_gaps | number | Breaks in an outline up to this wide are bridged before its inside is filled, in mm. |
| read_as | one of "auto", "outline", "ink" | "outline" fills line art's outline; "ink" takes a drawing coloured in as it is, with what it encloses left open. |
| toggle_areas | a list of string | Enclosed areas from the last report, by id, to switch between filled and open. |
| paper_areas | a list of string | Enclosed areas from the last report, by id, to switch between their colour and the paper's. |
| palette | whole number | The most colours the areas are given between them, 1 to 8: one AMS holds 4 filaments. |
Limits
- The picture stays in the tab it was attached in, gone on a reload; a keychain in the document is changed with the keychain tools, never by tracing again.
- No SVG or other vector import.
Examples
File, Picture to keychain…, choose a photo of a drawing.
Then: Review opens on the trace with the default settings, its areas in their colours.