mirror of
https://github.com/storytold/figcraft.git
synced 2026-12-04 19:41:51 -05:00
6911d897c2
Object ▸ Vectorize, the right-click menu (when every selected layer has an image fill), the
Actions palette, figcraft-cli and MCP run `image.vectorize {ids?, colors?, detail?,
keepOriginal?}`. Each layer's visible image fills, as they draw in its box, are traced into a
group of filled vector layers in the layer's place: one per colour, the largest area at the
bottom and each reaching under the ones above it, so they never leave hairline gaps. Transparent
areas get no shape, specks are dropped, outlines are simplified and gentle bends become curves
while corners stay sharp. The layer is replaced, or hidden under the result with keepOriginal;
one undo step.
The tracer is our own, in figcraft-pathops (`trace`): k-means colours from spread-out seeds,
pixel-edge outlines with holes, Douglas-Peucker simplification and midpoint curves.