Palette & binary modes
Median-cut colour quantization (default 8 colours) or a single luminance threshold for black-and-white output.
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.
$ 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 …>"}
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.
Every stage — quantize, segment, contour, simplify, fit — is implemented in Rust and shared by the CLI, the server, the MCP tools and this page.
Median-cut colour quantization (default 8 colours) or a single luminance threshold for black-and-white output.
8-connected segmentation walks each region’s boundary and emits outer contours plus holes with fill-rule="evenodd".
Douglas–Peucker simplification followed by least-squares curve fitting — editable paths, not a bitmap in a trench coat.
No RNG, no hash-order dependence. Identical input produces byte-identical SVG, so baselines and diffs stay meaningful.
One pipeline, many surfaces: vectors trace, vectors serve, vectors mcp serve, or the Rust crate compiled to WebAssembly.
The inverse direction renders SVG back to a sized PNG — exact grid or proportional — with resvg behind the raster feature.
An optional eval harness rasterizes the emitted SVG and scores MAE, PSNR, SSIM and edge agreement against committed baselines.
A static binary with no network calls. The web converter runs the same tracer in your browser — files never leave the machine.
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.
rasterpreprocesssegmentcontoursimplifybéziervectorSVG--debug-dir writes the quantized image, region map, fitted curves and intermediate SVG so you can see exactly which stage went wrong.
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.
Prebuilt binaries on the releases page, or build from source with Cargo.
$ curl -fsSL https://github.com/hieudoanm/vectors/releases/download/latest/vectors | shinstalled vectors to ~/.local/bin/vectors$ vectors logo.png logo.svgwrote logo.svg
$ 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.
Trace it in the browser above, or take the binary for your pipeline.