diff --git a/README.md b/README.md index 7865783..67e9524 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@

- Article + Article | - Demo + Demo | - Download + Download

- Built with 🦀 by The Vision Cortex Research Group + Built with 🦀 by The Vision Cortex Research Group ## Introduction @@ -28,7 +28,7 @@ Comparing to Adobe Illustrator's [Image Trace](https://helpx.adobe.com/illustrat 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](//www.visioncortex.org/vtracer-docs). +A technical description of the algorithm is on [visioncortex.org/vtracer-docs](https://www.visioncortex.org/vtracer-docs). ## Web App @@ -71,30 +71,41 @@ OPTIONS: -s, --splice_threshold Minimum angle displacement (degree) to splice a spline ``` -### Usage +### Install + +You can download pre-built binaries from [Releases](https://github.com/visioncortex/vtracer/releases). + +You can also install the program from source from [crates.io/vtracer](https://crates.io/crates/vtracer): + +```sh +cargo install vtracer ``` + +### Usage + +```sh ./vtracer --input input.jpg --output output.svg ``` -## Library +## Rust Library -The library can be found on [crates.io/vtracer](//crates.io/crates/vtracer) and [crates.io/vtracer-webapp](//crates.io/crates/vtracer-webapp). - -## Install - -Download pre-built binaries from [Releases](https://github.com/visioncortex/vtracer/releases). - -or - -Install from source (Rust toolchain needed): +You can install [`vtracer`](https://crates.io/crates/vtracer) as a Rust library. +```sh +cargo add vtracer ``` -cargo install vtracer + +## Python Library + +Since `0.6`, [`vtracer`](https://pypi.org/project/vtracer/) is also packaged as Python native extensions, thanks to the awesome [pyo3](https://github.com/PyO3/pyo3) project. + +```sh +pip install vtracer ``` ## In the wild -VTracer is used by the following products (feel free to add yours to the list): +VTracer is used by the following projects (feel free to add yours!): @@ -106,3 +117,15 @@ VTracer is used by the following products (feel free to add yours to the list):
+ +## What's next? + +There are several things in my mind: + +1. Pencil tracing. Instead of tracing shapes as closed paths, may be we can attempt to skeletonize the shapes as open paths. The output would be clean, fixed width strokes. + +2. Perfect cut-out mode. Right now in cut-out mode, the shapes do not share perfect boundaries, but have seams. + +3. Image cleaning. Right now the tracer works best on losslessly compressed pngs. If an image suffered from jpeg noises, it could impact the tracing quality. We might be able to develop a pre-filtering pass that denoises the input. + +If you are interested in working on them or willing to sponsor its development, feel free to get in touch. \ No newline at end of file diff --git a/cmdapp/README.md b/cmdapp/README.md new file mode 100644 index 0000000..c1699bb --- /dev/null +++ b/cmdapp/README.md @@ -0,0 +1,96 @@ +
+ + +

VTracer

+ +

+ Raster to Vector Graphics Converter built on top of visioncortex +

+ +

+ Article + | + Demo + | + Download +

+ + Built with 🦀 by The Vision Cortex Research Group +
+ +## 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. + +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. + +A technical description of the algorithm is on [visioncortex.org/vtracer-docs](https://www.visioncortex.org/vtracer-docs). + +## Cmd App + +```sh +visioncortex VTracer 0.4.0 +A cmd app to convert images into vector graphics. + +USAGE: + vtracer [OPTIONS] --input --output + +FLAGS: + -h, --help Prints help information + -V, --version Prints version information + +OPTIONS: + --colormode True color image `color` (default) or Binary image `bw` + -p, --color_precision Number of significant bits to use in an RGB channel + -c, --corner_threshold Minimum momentary angle (degree) to be considered a corner + -f, --filter_speckle Discard patches smaller than X px in size + -g, --gradient_step Color difference between gradient layers + --hierarchical + Hierarchical clustering `stacked` (default) or non-stacked `cutout`. Only applies to color mode. + + -i, --input Path to input raster image + -m, --mode Curver fitting mode `pixel`, `polygon`, `spline` + -o, --output Path to output vector graphics + --path_precision Number of decimal places to use in path string + --preset Use one of the preset configs `bw`, `poster`, `photo` + -l, --segment_length + Perform iterative subdivide smooth until all segments are shorter than this length + + -s, --splice_threshold Minimum angle displacement (degree) to splice a spline +``` + +### Install + +You can download pre-built binaries from [Releases](https://github.com/visioncortex/vtracer/releases). + +You can also install the program from source from [crates.io/vtracer](https://crates.io/crates/vtracer): + +```sh +cargo install vtracer +``` + +### Usage + +```sh +./vtracer --input input.jpg --output output.svg +``` + +## Rust Library + +You can install [`vtracer`](https://crates.io/crates/vtracer) as a Rust library. + +```sh +cargo add vtracer +``` + +## Python Library + +Since `0.6`, [`vtracer`](https://pypi.org/project/vtracer/) is also packaged as Python native extensions, thanks to the awesome [pyo3](https://github.com/PyO3/pyo3) project. + +```sh +pip install vtracer +``` diff --git a/cmdapp/src/lib.rs b/cmdapp/src/lib.rs index 3347464..752f842 100644 --- a/cmdapp/src/lib.rs +++ b/cmdapp/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020 Tsang Hao Fung. See the COPYRIGHT +// Copyright 2023 Tsang Hao Fung. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //