## Packages
VTracer 1.0 is a vectorization **framework** (pluggable frontends, curve fitters, color fitting, and output optimization) shipped across four surfaces from this repository:
| Package | Registry | Source | Use |
| --- | --- | --- | --- |
| `vtracer-cli` | [crates.io](https://crates.io/crates/vtracer-cli) | [`crates/vtracer-cli`](crates/vtracer-cli) | Command-line tool (`vtracer` binary) |
| `vtracer` | [crates.io](https://crates.io/crates/vtracer) | [`crates/vtracer`](crates/vtracer) | Rust library / the framework core |
| `vtracer` | [PyPI](https://pypi.org/project/vtracer/) | [`crates/vtracer-py`](crates/vtracer-py) | Python native extension (pyo3 + maturin) |
| `@visioncortex/vtracer` | [npm](https://www.npmjs.com/package/@visioncortex/vtracer) | [`nodejs`](nodejs) | Node.js WebAssembly build, no native dependency |
## 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](http://potrace.sourceforge.net/) which only accept binarized inputs (Black & White pixmap), VTracer has an image processing pipeline which can handle colored high resolution scans. tl;dr: Potrace uses a `O(n^2)` fitting algorithm, whereas `vtracer` is entirely `O(n)`.
Comparing to Adobe Illustrator's [Image Trace](https://helpx.adobe.com/illustrator/using/image-trace.html), VTracer's output is much more compact (less shapes) 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](https://www.visioncortex.org/vtracer-docs) and [clustering algorithm](https://www.visioncortex.org/impression-docs).
## Desktop App

The familiar web-app workflow, now on the native 1.0 engine:
+ **Native speed** — the engine runs natively instead of in-browser wasm, so conversions are quicker
+ **A/B comparator** — a sliding split view to check the trace against the original
+ **Curve inspector** — examine the fitted curves up close
+ **Seam-free cutout** — a true gapless tessellation with shared boundaries, no cracks between shapes
+ **Watershed clustering** — content-adaptive regions that follow object shape, with one interactive detail slider
+ **Curve simplification** — the fewest curves within a pixel tolerance, typically halving file size
+ **Adaptive B/W thresholding** — handles scans and photos with uneven lighting
+ **Fixed color palettes** — snap the output to your own colors
## Cmd App
Input and output can be given as positional arguments or as named flags:
```sh
vtracer input.jpg output.svg
# equivalent to:
vtracer --input input.jpg --output output.svg
```
Full options (flag names are kebab-case, e.g. `--filter-speckle`):
```sh
Usage: vtracer [OPTIONS] [INPUT] [OUTPUT]
Arguments:
[INPUT] Input raster image (positional; or use --input)
[OUTPUT] Output SVG (positional; or use --output)
Options:
-i, --input Path to the input raster image
-o, --output