vectors
Try itFeaturesHow it worksInstall
GitHub

Raster in, vectors out. Offline, deterministic, one binary.

vectors is a classical raster-to-vector tracer written in Rust: it quantizes an image into a palette, segments pixels into regions, walks their boundaries, fits Bézier curves, and emits clean SVG — then goes the other way and rasterizes SVG back to a sized PNG. No models, no uploads, no surprises.

Try the converterSource on GitHub
1
pipeline
0
network calls
byte
-identical output
vectors — first trace
$ vectors logo.png logo.svgwrote logo.svg — 12 paths, 8 colours$ vectors logo.svg icon.png --width 512wrote icon.png — 512×512$ vectors servelistening on http://localhost:8080$ curl -X POST localhost:8080/vectors \    -F "file=@logo.png"{"svg": "<svg …>"}

Try it right here.

The same Rust tracer, compiled to WebAssembly and running entirely in your browser. Drop a PNG and get editable SVG paths back.

The conversion runs entirely in your browser; no files are uploaded.

A real tracer, not a wrapper.

Every stage — quantize, segment, contour, simplify, fit — is implemented in Rust and shared by the CLI, the server, the MCP tools and this page.

Palette & binary modes

Median-cut colour quantization (default 8 colours) or a single luminance threshold for black-and-white output.

Real holes, not hacks

8-connected segmentation walks each region’s boundary and emits outer contours plus holes with fill-rule="evenodd".

Bézier-fitted curves

Douglas–Peucker simplification followed by least-squares curve fitting — editable paths, not a bitmap in a trench coat.

Deterministic output

No RNG, no hash-order dependence. Identical input produces byte-identical SVG, so baselines and diffs stay meaningful.

CLI, API, MCP & library

One pipeline, many surfaces: vectors trace, vectors serve, vectors mcp serve, or the Rust crate compiled to WebAssembly.

SVG → PNG too

The inverse direction renders SVG back to a sized PNG — exact grid or proportional — with resvg behind the raster feature.

Measured, not vibes

An optional eval harness rasterizes the emitted SVG and scores MAE, PSNR, SSIM and edge agreement against committed baselines.

Offline & private

A static binary with no network calls. The web converter runs the same tracer in your browser — files never leave the machine.

One linear pipeline.

Each stage consumes the previous stage's type and knows nothing about how the next one renders. Deterministic by construction — no RNG, no hash-order dependence.

raster→preprocess→segment→contour→simplify→bézier→vector→SVG

Debug artefacts

--debug-dir writes the quantized image, region map, fitted curves and intermediate SVG so you can see exactly which stage went wrong.

Measured accuracy

The optional eval harness rasterizes the emitted SVG and scores it against the source — MAE, PSNR, SSIM, edge agreement — so quality claims are numbers, not vibes.

Up and running in under a minute.

Prebuilt binaries on the releases page, or build from source with Cargo.

install script
$ curl -fsSL https://github.com/hieudoanm/vectors/releases/download/latest/vectors | shinstalled vectors to ~/.local/bin/vectors$ vectors logo.png logo.svgwrote logo.svg
build from source
$ git clone https://github.com/hieudoanm/vectors$ cd vectors/crates$ cargo build --release -p vectors-cli$ ./target/release/vectors --helpConvert raster images (PNG, JPG) into SVG vector paths

Also available as an HTTP API (vectors serve), an MCP server (vectors mcp serve), and a Rust library — full CLI reference in the README.

Your next logo deserves real paths.

Trace it in the browser above, or take the binary for your pipeline.

Convert an imageStar on GitHub
vectors — raster to vector, offlineRust · WebAssembly · MIT · github.com/hieudoanm/vectors