Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vtracer

> 编程语言
Open source

Raster to Vector Graphics Converter

6.5K stars0 likes0 views
WebsiteGitHub

About

Raster to Vector Graphics Converter

Introduction

visioncortex VTracer is an open source software to convert raster images (like jpg & png) into vector graphics (svg). It can vectorize graphics and photographs and trace the curves to output compact vector files.

Comparing to Potrace, VTracer has an image processing pipeline which can handle colored images. VTracer skips Potrace's expensive optimal-polygon search in favor of a fast, linear pipeline that stays faithful to high-resolution images.

Comparing to Adobe Illustrator's Image Trace, VTracer's output is much more compact as we adopt a stacking strategy and avoid producing shapes with holes.

VTracer is originally designed for processing high resolution scans of historic blueprints up to gigapixels. At the same time, VTracer can also handle low resolution pixel art, simulating image-rendering: pixelated for retro game artworks.

Technical descriptions of the tracing algorithm and clustering algorithm.

Desktop App

VTracer App powered by the 1.0 tracing engine:

  • Native speed: faster conversions on large images
  • A/B comparator: compare the trace against the original
  • Curve inspector: inspect fitted curves up close
  • Curve simplification: fewer nodes, often half the file size
  • Seam-free cutout: gapless shapes with shared boundaries
  • Watershed clustering: edge-aware regions for sharper image traces
  • Adaptive B/W thresholding: cleaner traces from uneven scans and photos
  • Fixed color palettes: snap output to your own colors

Console App

You can download pre-built binaries from Releases.

You can also install the program from source:

cargo install vtracer-cli

Usage

# simplest form
./vtracer input.jpg output.svg

# black & white line art
./vtracer input.jpg output.svg --preset bw

# scanned/photographed line art with uneven lighting
./vtracer scan.jpg output.svg --clustering bw --adaptive

# seam-free mosaic (gapless tessellation)
./vtracer input.jpg output.svg --hierarchical cutout

# watershed region forming, cut to taste
./vtracer photo.jpg output.svg --clustering watershed --watershed-detail 192

# constrain to a fixed palette
./vtracer input.jpg output.svg --palette '#1b1b1b,#e0c088,#5a7d3c,#8fb0d0'

Full options:

…

The spline fine-tuning flags --corner-threshold <0..=180>, --segment-length <3.5..=10>, and --splice-threshold <0..=180> are still accepted but hidden from --help: their defaults (60 / 4 / 45) serve virtually every conversion, and --simplify is the knob that actually moves output size and smoothness.

New in 1.0

  • Positional arguments: vtracer in.png out.svg.
  • --hierarchical cutout is now a true seam-free mosaic (a gapless tessellation with shared boundaries), replacing the old re-clustered cutout.
  • --palette / --palette-file: snap colors to a fixed palette (nearest in OKLab); --max-colors auto-quantizes the palette.
  • Binary thresholding: a tunable fixed cutoff (--threshold) or Bradley–Roth adaptive thresholding (--adaptive, with --adaptive-window / --adaptive-t) for scans with uneven lighting.
  • --simplify <tolerance>: paper.js-style curve simplification: re-fits smooth runs with the fewest cubics that stay within the tolerance (px), typically halving file size; seam-free in cutout mode because shared boundaries are simplified once for both faces.
  • --clustering watershed: an alternative region-forming algorithm: a hierarchical watershed on the pixel graph (Cousty et al., TPAMI 2009; Najman, Cousty & Perret, ISMM 2013), cut at --watershed-detail. Content-adaptive regions that follow object shape: pairs beautifully with cutout.

Programming Libraries

VTracer 1.0 is a vectorization framework with pluggable stages: segmentation, curve fitting, color fitting, and output optimization — usable from the command line or as a library in Rust, Python, and JavaScript:

Package Registry Source Use vtracer-cli crates.io crates/vtracer-cli Command-line tool (vtracer binary) vtracer crates.io crates/vtracer Rust library / the framework core vtracer PyPI crates/vtracer-py Python native extension (pyo3 + maturin) @visioncortex/vtracer npm nodejs Node.js WebAssembly build, no native dependency

Rust Library

cargo add [email protected]
…

Split the pipeline when you want the stages separately — segment caches, finish re-runs:

let pipeline = cfg.build()?;
let seg = pipeline.segment(&img)?;        // the expensive part
let doc = pipeline.finish(&seg)?;         // VectorDoc, ready to serialize

See docs.rs/vtracer for the full API.

Python Library

pip install vtracer==1.0.0a4
…

See crates/vtracer-py for the full API.

Node.js Library

@visioncortex/vtracer is available for Node as a WebAssembly build (from the nodejs package) — image decoding and vectorization both run in wasm, so there is no native dependency. Decodes PNG, JPEG, GIF, BMP, and WebP; for other formats, decode yourself and pass raw RGBA to convertPixels.

npm install @visioncortex/[email protected]
const vtracer = require('@visioncortex/vtracer');

await vtracer.convertFile('in.png', 'out.svg', { mode: 'polygon' });
const svg = vtracer.convertBuffer(buffer, { preset: 'poster' });
const svg2 = vtracer.convertPixels(rgba, width, height, { clustering: 'bw' });

// binary with adaptive thresholding
const bw = vtracer.convertBuffer(buffer, { clustering: 'bw', adaptive: true });

Citations

VTracer has since been cited by a few academic papers in computer graphics / vision research. Please kindly let us know if you have cited our work:

  • SKILL 2023 Framework to Vectorize Digital Artworks for Physical Fabrication based on Geometric Stylization Techniques
  • arXiv 2023 Image Vectorization: a Review
  • arXiv 2023 StarVector: Generating Scalable Vector Graphics Code from Images
  • arXiv 2024 Text-Based Reasoning About Vector Graphics
  • arXiv 2024 Delving into LLMs' visual understanding ability using SVG to bridge image and text

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •Native speed: faster conversions on large images
  • •A/B comparator: compare the trace against the original
  • •Curve inspector: inspect fitted curves up close
  • •Curve simplification: fewer nodes, often half the file size
  • •Seam-free cutout: gapless shapes with shared boundaries
  • •Watershed clustering: edge-aware regions for sharper image traces
  • •Adaptive B/W thresholding: cleaner traces from uneven scans and photos
  • •Fixed color palettes: snap output to your own colors
  • •Positional arguments: vtracer in.png out.svg.
  • •--hierarchical cutout is now a true seam-free mosaic (a gapless

> Tags

Rustimage-procesingrustsvg

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言