shunyagatha/Vecline

View on GitHub ↗

Measurable image + document toolkit. Bit-exact SVG from flat art (SSIM 1.0000, verified by rendering it back); beats potrace, imagetracerjs and vtracer on photographs. 11 raster formats, every pair convertible. Cut-ready DXF with real physical size, EPS, PDF, G-code. PDF & Office rendering. MCP server for agents. Zero-dependency portable core.

12 ★1 forksTypeScriptUpdated 18d ago

What you need to know

Vecline — a fast raster-to-SVG vectorizer (CLI, library, and 12-tool stdio MCP server) with four strategies (lossless/pixel/trace/embed) and a verified lossless guarantee: --lossless returns a bit-exact SVG or fails, plus a 121-conversion format matrix and a zero-dependency core.

Install

npm install -g vecline (CLI) / npm install vecline (library).
MCP server is inside the package: { "command": "npx", "args": ["-y", "vecline", "mcp"] } (also claude mcp add vecline -- npx -y vecline mcp).
One-click: download vecline.mcpb from the latest release and open it with Claude Desktop (a launcher that prefers vecline on PATH).
Requires Node.js 18.17+; native deps (sharp, resvg-js) ship prebuilt binaries for Linux/macOS/Windows.

Usage

  • vecline vectorize logo.png; add --verify to prove the result, --lossless for a bit-exact guarantee that fails rather than emitting a near-miss.
  • vecline vectorize portrait.jpg --target-ssim 0.95 to trace to curves escalating settings until a quality target is met.
  • vecline convert photo.png thumb.webp (raster->raster), logo.png logo.svg (raster->vector), logo.svg logo@2x.png (vector->raster) — convert reads bytes AND extension.
  • vecline rasterize logo.svg -o logo@4x.png --scale 4; vecline extract keep.svg -o recovered.png --against logo.png as a CI gate (exits non-zero on byte mismatch).
  • vecline mcp starts the MCP server: vectorize, convert, centerline, measure, diff, crop, doc_to_images, office_convert, images_to_pdf, palette, placeholder, image_info.

Key features

  • Four strategies: lossless (bit-exact, verified; fails loudly otherwise), pixel (real rectangles/contours that rasterize back to zero differing pixels), trace (Bézier curves, approximate and measured via SSIM), embed (original bytes preserved, SHA-256 recorded).
  • Square format matrix — every format read is written (PNG, JPEG, WebP, AVIF, TIFF, GIF, BMP, ICO/CUR, PNM, TGA, SVG) = 121 conversions, all tested per commit.
  • Zero-dependency core (vecline/core, 96 KB minified, CI-bundled for browsers) accepts plain ImageData; optional native deps make the full install ~100 MB vs 2 MB core-only.
  • Custom codec registration (registerDecoder) plugs new formats in without affecting other users.
  • MCP server is listed in the official MCP registry as io.github.shunyagatha/vecline and on Smithery; privacy: nothing is shared because nothing is collected; MIT/free.

Best for

Agents that need to convert images to SVG (logos, pixel art, icons, screenshots, or approximate curves from photos) in pipelines where exactness or honest measurement matters.

Caveats

  • Raster->SVG in traced curves can never be exact for photos — any promise otherwise is a bitmap embed or wrong; Vecline is upfront about which mode you got.
  • Exact geometry on a photo costs ~1 rectangle per pixel (e.g. 42,933 shapes / 1.99 MB) — auto mode embeds the bitmap instead and reports the ratio.
  • Embedded JPEGs survive byte-for-byte but do NOT render bit-identically (resvg DCT rounding) — strict --lossless discards that candidate and says so.
  • HEIC, JPEG XL, JPEG 2000, PSD, PDF and camera RAW are not built in — you must register a WASM decoder or convert with another tool first.
Platforms: LocalClients: Claude Code · Codex · VS Code · Cursor · Claude Desktop · Continue

Reviewed 2026-08-18

Topics

browserdxfimage-conversionimage-conversion-toolimage-processingimage-tracingjpg-to-svglaser-cutterlosslessmcpmodel-context-protocolpdfpng-to-svgpotraceraster-to-vectorssimsvgsvg-to-pngvectorizerwebp-to-svg
Stars
12★
Forks
1
Language
TypeScript
License
MIT
Created
2026-08-13
Last push
2026-08-17