millisketch

Skills and pictures

Trace a picture

trace_picture

Traces an attached drawing, read for its outline and colours.

EditorTools tabAgentMCP
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 takes project, editor and request_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.

InputTypeWhat it is
picturestringThe picture's id from <pictures>; the last one attached when left out.
sizenumberThe drawing's longest side, in mm.
thinnest_linenumberLines thinner than this are thickened to it; 0 keeps them as drawn, in mm.
rotateone of 0, 90, 180, 270A clockwise turn of the picture, in degrees.
cropsee 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.
backgroundone of "auto", "light", "dark"Light paper with dark ink, or the other way round.
even_lightingbooleanDivide out uneven light, such as a shadow. Turn off for a drawing coloured in solid.
thresholdnumber or nullHow dark, from 2 to 98 % of white, a pixel must be to count as ink; null is automatic.
remove_specksnumberInk pieces smaller across than this are dust, in mm.
close_gapsnumberBreaks in an outline up to this wide are bridged before its inside is filled, in mm.
read_asone 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_areasa list of stringEnclosed areas from the last report, by id, to switch between filled and open.
paper_areasa list of stringEnclosed areas from the last report, by id, to switch between their colour and the paper's.
palettewhole numberThe 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

A drawing to a trace

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.