/rasterless:rasterlessfrom rasterless
Convert icons, logos, and other flat art (PNG, JPG, WebP) into clean, small SVG files with one named layer per object, by tracing them with Potrace. Use this instead of writing SVG by hand whenever the user has an image and wants it as SVG: a hand-drawn SVG does not match the image, this matches it and checks the result. Use it whenever the user wants to vectorize, trace, or convert an icon, glyph, logo mark, emoji, favicon, app icon, UI symbol, or flat illustration into SVG, including requests like "make this png an svg", "I need this icon as a vector", "convert my icons folder to svg", "turn this flaticon download into svg", or "get me an svg version of this logo", even if they never say "trace" or "vectorize". Handles single-color glyphs, flat multi-color icons, and shaded grayscale 3D-style illustrations, single files or whole folders. Not for photos or full-color painted illustrations.
Ships in rasterless. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Converts flat icons into SVGs that look like a designer drew them: one layer per object (a face, each eye, the mouth), stacked the way a designer stacks them, with sub-pixel accurate edges, a viewBox, and no bloat. The script does the tracing and finds the layers. Your job is to run it, look at the result, decide the real objects and groups the way a designer would, run it again with that plan, and deliver. Users rarely ask for layers in words, but a file with named objects and groups is what they need, so plan the objects even when the request is just "make this svg".
Two scripts:
rasterless.py for flat icons (the default, covered first below).rasterless_shaded.py for shaded grayscale art: 3D-style illustrations, glossy spheres, soft shadows. See Shaded art below.fill-opacity. Up to 24 colors are kept by default. When an icon has more, the smallest colors are merged into their nearest kept color.l1 at the bottom, counting up). --by-color gives one path per color instead.python3 <skill-dir>/scripts/rasterless.py INPUT.png --preview
rasterless.py icons/ -o svg/ --preview. With -o pointing at a folder, every SVG goes there. Without -o, each SVG lands next to its input.failed, the rest still convert, and the run exits with code 1. Two inputs with the same name (logo.png, logo.jpg) become logo.svg and logo-jpg.svg. An empty image prints skipped, no artwork found.-o out.svg names the output for a single input.--preview writes the preview PNG and a layer map PNG to a temp folder and prints both paths, so the output folder holds only the SVGs.uv (Claude Code, Codex), run uv run <skill-dir>/scripts/rasterless.py ... instead of python3. The script declares its own dependencies, so uv installs them on first run.pillow, numpy, and scipy. rasterless_shaded.py also needs opencv-python-headless. Web sandboxes usually have all four. If one is missing and the sandbox can install packages, pip install it. Without scipy, rasterless.py still works, but writes one path per color and says so.scripts/vendor, so nothing else is required. resvg-py is optional: without it, the check and the preview use a built-in renderer (the report says built-in renderer), so they work with no network. Only rasterless_shaded.py needs resvg-py for its check./mnt/data in ChatGPT, /mnt/user-data/outputs in Claude.ai) and give the user the download link.Each file prints one line:
house.svg: mono, 1 layer [#111111], 26 segments, 0.7 KB, mismatch 0.00%, preview /tmp/.../house.preview.png, layer map /tmp/.../house.layers.png
saucer.svg: 6 colors, 13 layers [#ffd983 #ccd6dd ...], 239 segments, 6.0 KB, mismatch 0.00%, preview /tmp/.../saucer.preview.png, layer map /tmp/.../saucer.layers.png
battery.svg: mono, 4 layers [#000000@20% #000000], 55 segments, 1.5 KB, mismatch 0.00%, preview /tmp/.../battery.preview.png, layer map /tmp/.../battery.layers.png
Open the printed preview image and look at it. It shows three panels: original | SVG render | mismatches in red. Transparent icons sit on gray, so holes and missing white parts are visible.
Look at it even when the mismatch is 0%. The number only counts clear misses, and it means nothing for gradient icons, where banding passes as a match. A color that came out slightly wrong, or a small detail that vanished, is something only your eyes catch. For a batch, check every preview that has a warning, a mismatch above 0.5%, or a color count that looks wrong for the icon.
This is what turns a trace into a file a designer can work with. Do it for a single file or a few, even when the user only said "make this svg". For a large batch, skip it unless the user asks, and name the layers by hand instead (below).
Open the original image and the printed layer map. The map tints each layer and prints its id (l1, l2, ...) at its center.
Decide the real objects, the way a designer would draw them, and group them (rocket, laptop, head). Write plan.json, objects listed back to front:
{"objects": [
{"name": "planet-body", "group": "planet", "layers": ["l21", "l15"]},
{"name": "ring", "group": "planet", "layers": ["l20"]},
{"name": "fins", "group": "rocket", "layers": ["l11", "l13"]},
{"name": "window", "group": "rocket", "layers": ["l22", "l25"]}
],
"drop": ["l23", "l27"]}
Run again with the plan: rasterless.py INPUT.png -o OUT.svg --objects plan.json --preview. Use the same input and flags as the first run, so the layer ids mean the same thing.
Check the report and the new map. Parts the plan left out were joined to a neighbor by guess and are marked ?; add them to the right object and run again. Stop after two re-runs.
How designers split and group, so follow these unless the user wants otherwise:
"points": [[x, y], ...], a few points in input pixels, spread inside that part. The layer is split by nearest point."drop", so it becomes see-through. Real white parts (teeth, eye whites, a white cloud) stay objects.face, left-eye, hat-band). Left and right as the viewer sees them. Group names differ from object names (group planet, objects planet-body and ring).The SVG gets one <g> per group, one path per object (a <g> when an object has several colors), and your names as ids.
Naming by hand (large batches, or without a plan): rename the ids in the SVG from the layer map. Replace the exact attribute, quotes included, so l1 never hits l10: id="l3" becomes id="hat-band". Check each layer's fill against the preview before naming it, because a small layer's label can sit next to a bigger layer. Leave lN when you cannot tell. With --by-color there are no ids.
| What you see | Cause | Fix |
|---|---|---|
| Two shades merged into one, or a detail color missing | Palette detection merged colors or missed a tiny one | --colors N with the true color count |
A tiny feature (mouth, iris) took a neighbor's color, and the report shows 24 colors with a 24+ colors warning | The icon has more flat colors than the default cap | --colors N above 24 (for example 28) |
| Extra near-duplicate colors | Noise was read as a separate color | --colors N with the true color count |
| Rounded-square or full-bleed background disappeared from an app icon | Solid background was treated as backdrop | --keep-bg (paints it as the bottom layer) |
| A white part touching the image edge is missing on a white JPG | It is connected to the white background, so it reads as backdrop | Ask for a transparent PNG, or use --keep-bg if a white square is acceptable |
| The user wants to recolor every part of one color in one place | Each object is its own layer | --by-color (one path per color, no layer ids) |
WARNING: gradient or shading detected or 24+ colors on grayscale art | The art is shaded, not flat | Switch to rasterless_shaded.py (see Shaded art) |
| The same warning on a full-color image | The icon is not flat | Tell the user it was approximated with flat color bands. For a well-known brand logo (Instagram, Google), point them to the official SVG from the brand's press or brand page instead |
Re-run with the flag, then look at the preview again.
Use it when the image is grayscale with smooth shading, or when rasterless.py warned about gradients on such an image. Flat tracing breaks this kind of art into speckled bands, and thin light gaps that touch the page come out as see-through holes.
python3 <skill-dir>/scripts/rasterless_shaded.py INPUT.png --preview
How it works:
--spheres, round glossy balls are detected and replaced by circles that use a fitted radial gradient.Flags:
--spheres: use it when the art has glossy balls or nodes. Check the preview: every ball should be covered, and nothing else should turn into a ball.--levels N: more bands (28 or 32) for visible steps in large smooth areas. Fewer (12) for a smaller file.--blur S: 0 gives hard bands (no filter, best for design-tool import). Raise it to 1.5 or 2 for softer shading at the cost of softer edges.Color images are skipped with a message, so use rasterless.py for those. Expect 300 KB to 1 MB for a detailed 1000px illustration. Tell the user that the result is a smooth approximation, that the blur filter renders in all browsers but may import differently in design tools, and that a soft shadow ends in a faint visible edge on a non-white background.
viewBox and no fixed size, so it scales with CSS. A dark single-color icon gets fill="currentColor", so color: red in CSS recolors it. This includes duotone icons, whose lighter layer keeps its fill-opacity. A colored mono icon (for example a red heart) keeps its color.--design (Figma, Illustrator, print). Exact hex colors everywhere, plus width and height in pixels.Use the default unless the user mentions a design tool or needs exact colors.
Tell the user the output path, the groups and objects you made, the size, and anything you noticed in the preview, including any layers you dropped as background. Mention a warning if one fired. Do not paste the SVG path data into chat; it is long and useless to read.
When it fits the user's setup, add one line of usage advice:
color recolors it.<img src>. Pasting the markup inline into JSX breaks on fill-rule, which JSX spells fillRule.rasterless.py is built for flat icons: solid colors, crisp edges. Heavy gradients produce banded approximations, and the warning catches these.rasterless_shaded.py covers grayscale shading only. Tinted one-hue art counts as color and is skipped. Photos and full-color painted illustrations have no good automatic vector form. Offer a hand redraw with real SVG gradients instead.--spheres finds balls of about 1.5% to 5% of the image width. It can miss them on small inputs (300px and below).#fecb4c where the designer used #ffcc4d. Snap to known brand colors by hand if the user cares.agents/openai.yaml (opens in a new tab)assets/icon.svg (opens in a new tab)scripts/rasterless.py (opens in a new tab)scripts/rasterless_shaded.py (opens in a new tab)scripts/vendor/potrace/LICENSE (opens in a new tab)scripts/vendor/potrace/NOTICE (opens in a new tab)scripts/vendor/potrace/__init__.py (opens in a new tab)scripts/vendor/potrace/potrace.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dheerajponnaganti/rasterless --plugin rasterless