#svg #computer-graphics

bin+lib vtracer

A cmd app to convert images into vector graphics

7 releases (4 breaking)

0.5.0 Oct 9, 2022
0.4.0 Jul 23, 2021
0.3.0 Jan 24, 2021
0.2.1 Dec 18, 2020
0.1.0 Oct 31, 2020

#154 in Images

Download history 38/week @ 2023-02-01 35/week @ 2023-02-08 36/week @ 2023-02-15 19/week @ 2023-02-22 24/week @ 2023-03-01 20/week @ 2023-03-08 22/week @ 2023-03-15 41/week @ 2023-03-22 19/week @ 2023-03-29 22/week @ 2023-04-05 40/week @ 2023-04-12 64/week @ 2023-04-19 23/week @ 2023-04-26 59/week @ 2023-05-03 48/week @ 2023-05-10 23/week @ 2023-05-17

160 downloads per month


621 lines


Raster to Vector Graphics Converter built on top of visioncortex

Article | Demo | Download

Built with 🦀 by The Vision Cortex Research Group


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 which only accept binarized inputs (Black & White pixmap), VTracer has an image processing pipeline which can handle colored high resolution scans.

Comparing to Adobe Illustrator's Image Trace, 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.

A technical description of the algorithm is on visioncortex.org/vtracer-docs.

Web App

VTracer and its core library is implemented in Rust. It provides us a solid foundation to develop robust and efficient algorithms and easily bring it to interactive applications. The webapp is a perfect showcase of the capability of the Rust + wasm platform.



Cmd App

visioncortex VTracer 0.4.0
A cmd app to convert images into vector graphics.

    vtracer [OPTIONS] --input <input> --output <output>

    -h, --help       Prints help information
    -V, --version    Prints version information

        --colormode <color_mode>                 True color image `color` (default) or Binary image `bw`
    -p, --color_precision <color_precision>      Number of significant bits to use in an RGB channel
    -c, --corner_threshold <corner_threshold>    Minimum momentary angle (degree) to be considered a corner
    -f, --filter_speckle <filter_speckle>        Discard patches smaller than X px in size
    -g, --gradient_step <gradient_step>          Color difference between gradient layers
        --hierarchical <hierarchical>
            Hierarchical clustering `stacked` (default) or non-stacked `cutout`. Only applies to color mode.

    -i, --input <input>                          Path to input raster image
    -m, --mode <mode>                            Curver fitting mode `pixel`, `polygon`, `spline`
    -o, --output <output>                        Path to output vector graphics
        --path_precision <path_precision>        Number of decimal places to use in path string
        --preset <preset>                        Use one of the preset configs `bw`, `poster`, `photo`
    -l, --segment_length <segment_length>
            Perform iterative subdivide smooth until all segments are shorter than this length

    -s, --splice_threshold <splice_threshold>    Minimum angle displacement (degree) to splice a spline


./vtracer --input input.jpg --output output.svg


The library can be found on crates.io/vtracer and crates.io/vtracer-webapp.


Download pre-built binaries from Releases.


Install from source (Rust toolchain needed):

cargo install vtracer

In the wild

VTracer is used by the following products (feel free to add yours to the list):

Do anything to any file

Smart logo design


~93K SLoC