Nedda & CC's SVG Converter β turn pixel art and flat-color images into true vector SVG, point by point.
No Inkscape. No embedded bitmaps pretending to be vectors. Every pixel becomes a real <rect>,
merged into clean shapes, grouped by color β an SVG you can scale to a billboard.
Most "image to SVG" exports just wrap your PNG inside an <image> tag (still a bitmap),
and most tracers smear pixel art into wobbly paths. SquareKoi does the honest thing:
it scans your image pixel by pixel and rebuilds it as crisp vector rectangles.
- π¨ Color quantization β reduce to 8 / 16 / 32 / 64 / custom colors (median-cut), kills anti-aliasing noise
- πͺ Auto pixel-grid detection β pixel art exported at 2x/10x is detected (GCD-based) and shrunk back to its logical resolution: dramatically smaller files
- π» Two transparency modes β native PNG alpha is preserved (unpainted = transparent), or chroma-key any background color away (
autosamples the corners) - π¦ Batch or single β drop a folder of frames, get a folder of SVGs
- π₯οΈ Double-click launchers for macOS & Windows (native dialogs, no server, no port) + full CLI
- π‘οΈ Complexity guardrail β refuses to emit a 30 MB monster for a photo, tells you what to do instead
- Zero dependencies except Pillow
- macOS β double-click
SquareKoi.command - Windows β double-click
SquareKoi.bat(needs Python 3 with "Add to PATH" checked)
Native dialogs walk you through it:
- Pick images (multi-select OK) β or a whole folder for batch
- Pick a color tier (Original / 8 / 16 / 32 / 64 / custom)
- Pick background handling (PNG transparency / auto remove / custom color)
- Done β the
out/folder pops open with your SVGs β¨
Windows launcher note: dialogs are PowerShell 5.1 native; if your art comes out odd, try the CLI and open an issue.
pip install pillow
python3 img2svg.py # convert everything in in/ -> out/
python3 img2svg.py sprite.png # single file
python3 img2svg.py art.png --colors 16 # quantize to 16 colors
python3 img2svg.py photo.jpg --key auto # auto-remove background color| Option | Default | What it does |
|---|---|---|
--colors N |
0 (off) |
Quantize palette to N colors (median-cut) |
--pixel auto|N |
auto |
Detect & shrink the pixel grid (or force block size N) |
--key auto|'#rrggbb' |
off | Chroma-key a background color to transparency |
--key-tol N |
40 |
Chroma-key color distance tolerance |
--alpha N |
128 |
Alpha below this is treated as transparent |
--max-rects N |
50000 |
Complexity guardrail |
- Transparency first β alpha & chroma-key are resolved on the original colors (quantizing first would shift colors and break the key)
- Quantize β masked areas are flattened to one palette slot so your actual artwork gets the full color budget
- Grid detection β the GCD of all row/column change positions gives the largest lossless pixel block; the image is shrunk back with per-block majority vote
- Rect merging β horizontal runs of identical color become one
<rect>, identical runs stack vertically into taller rects - Output β rects grouped per color under
<g fill>, integer coordinates,shape-rendering="crispEdges"
Pixel-art sweet spot: a 16Γ16 sprite exported at 192Γ192 β 17 rects, 3 colors, 0.9 KB.
File-size rule of thumb (measured on an anti-aliased 268Γ175 sprite): beyond 8 colors, each doubling of the palette costs roughly +50β60% file size. Clean pixel art is unaffected β its real palette is already tiny.
Continuous-tone images (photos, gradients) don't belong in rect-SVG land. The guardrail will stop you. A tracing mode (vtracer-style paths) may come later.
Made with β₯ by Nedda & CC β born the day we needed 11 koi-fish animation frames as vectors.