Split a sheet of icons
split_icon_sheetSplits a contact sheet grid of icons into individual traced SVGs with transparent backgrounds, consistent ink, and icon-set-ready viewBoxes.
Instructions
Cut a CONTACT SHEET — a grid of many icons on one canvas, which is what image models usually return for "a set of icons" — into individual traced SVGs. Detects the tiles (grid or free layout; pass grid when you know the layout, which also keeps an icon drawn as separate pieces whole), crops each with the sheet's own paper colour, and traces each one with its own plan: a one-ink glyph goes mono, a shaded badge goes colour. Tiles come back transparent (removeBackground is ON here) and every mono tile of the same ink is painted in ONE ink, so a set stays consistent; ink: "currentColor" and normalize: 24 give you icon-set-ready files in one call. Caption text under the icons is detected and reported, but not read (OCR is browser-only), so tiles are named by position — or by names, in reading order. Each run records what it wrote in logolab-sheet.json and removes what a previous run with the same prefix left behind.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sheet": "<sheet>",
"outDir": "<outDir>"
},
"name": "split_icon_sheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gap | No | Force the grouping gap in source px. Omit to detect it; prefer `grid` when the layout is known. | |
| ink | No | Paint a MONO trace in this instead of the ink the probe read: a hex colour, or "currentColor" so the icon takes the CSS text colour (what an icon set wants). Colour traces keep their colours. | |
| grid | No | The layout, when you know it: { rows, cols }. Everything inside one cell is one icon, however far apart its pieces are (a dashed curve, four corner brackets, a dashboard of four rectangles) — the case no `gap` value can express. Omit to detect the layout. | |
| mode | No | Per-tile colour decision. Default auto. | |
| inset | No | With normalize: units kept clear on each side. Default size/12 (2 on a 24 grid, as Lucide draws). | |
| limit | No | Trace at most this many tiles (tracing is the slow part). A limited run is a preview: it removes nothing. | |
| names | No | File names for the icons in READING order (row-major, top-left first): ["home", "search", …] writes home.svg, search.svg, …. Icons past the end of the list keep <prefix>-nn. | |
| quiet | No | Return only the summary (one line per icon for a sheet) and skip the JSON block. For batches, where the JSON repeats what the summary says. | |
| sheet | Yes | Path to the sheet image. | |
| detail | No | high lifts the flat-art raster cap 2048 → 4096: crisper, ~4x the work. | |
| outDir | Yes | Directory to write one SVG per detected icon into. | |
| prefix | No | File-name stem: <prefix>-01.svg. Default: the sheet file name. | |
| padding | No | Padding around each icon as a fraction of its long side. Default 0.08. | |
| strokes | No | Trace LINE ART as centreline strokes with a measured stroke-width (open and closed stroked paths you can re-weight), instead of filled outlines of each line. Ink no stroke explains (a dot, a note head) still becomes a fill. In colour mode each stroke is painted in the ink it runs through. Default off. | |
| fidelity | No | Shape-beautification tolerance in px; 0 disables snapping to circles/lines. | |
| layering | No | Colour mode. stacked (default): a shape paints under the shapes in front of it — fewer nodes, no hairline seams between colours, shapes stay whole in a design tool. tiled: shapes fit edge to edge, with a hole wherever another sits inside. Same edges either way; mono ignores it. | |
| despeckle | No | 0 keeps every speck, 100 is aggressive. Default 25. | |
| gradients | No | Default auto. | |
| keepCrops | No | Also write each tile as a PNG next to its SVG. | |
| normalize | No | Refit the SVG into a square viewBox of this many units: normalize: 24 fits the art into "0 0 24 24", centred, with `inset` units clear on every side, coordinates rounded to 2 decimals — so every icon of a set shares one grid. Stroke widths scale with it. Omit to keep the viewBox at the traced pixel size. | |
| smoothing | No | 0 = crisp and node-dense, 100 = smooth and sparse. Default 50. | |
| threshold | No | How far from the paper colour a pixel counts as ink. Default 24. | |
| strokesOnly | No | With `strokes`: NO filled paths at all — the ink no stroke explains (a dot, a note head, a solid shape) is drawn as round-capped strokes too, along its own middle and as wide as it is there; a dot is a round-capped point. Nothing is dropped, but a shape that is not a line is approximated (a square comes back with round ends). For plotters and stroke-only icon sets. Default off. | |
| removeBackground | No | Default TRUE on a sheet: tiles come back transparent. Pass false to keep each tile's paper as a rectangle under the ink. |