5 Commits

Author SHA1 Message Date
Chris Tsang ba0ab63a92 vtracer 0.1.1 2020-11-01 14:54:33 +08:00
Chris Tsang 3df69f6274 svg namespace 2020-11-01 14:52:44 +08:00
Chris Tsang 5efd479885 Docs 2020-10-31 19:18:45 +08:00
Chris Tsang 105bdfc7a3 Space 2020-10-31 19:16:41 +08:00
Chris Tsang d8b6d1cf33 Docs 2020-10-31 19:12:15 +08:00
4 changed files with 30 additions and 6 deletions
+27 -2
View File
@@ -1,6 +1,22 @@
![logo](docs/images/visioncortex-banner.png) <div align="center">
# visioncortex VTracer <img src="docs/images/visioncortex-banner.png">
<h1>visioncortex VTracer</h1>
<p>
<strong>Raster to Vector Graphics Converter built on top of visioncortex</strong>
</p>
<h3>
<a href="//www.visioncortex.org/vtracer-docs">Docs</a>
<span> | </span>
<a href="//www.visioncortex.org/vtracer/">Demo</a>
</h3>
<sub>Built with 🦀 by <a href="//www.visioncortex.org/">The Vision Cortex Research Group</a></sub>
</div>
## 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. 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.
@@ -50,3 +66,12 @@ OPTIONS:
``` ```
./vtracer --input input.jpg --output output.svg ./vtracer --input input.jpg --output output.svg
``` ```
## Library
The library can be found on [crates.io/vtracer](//crates.io/crates/vtracer).
### Install
```
vtracer = "0.1.0"
```
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "vtracer" name = "vtracer"
version = "0.1.0" version = "0.1.1"
authors = ["Chris Tsang <tyt2y7@gmail.com>"] authors = ["Chris Tsang <tyt2y7@gmail.com>"]
edition = "2018" edition = "2018"
description = "A cmd app to convert images into vector graphics." description = "A cmd app to convert images into vector graphics."
+1 -2
View File
@@ -29,8 +29,7 @@ impl SvgFile {
pub fn to_svg_file(&self) -> String { pub fn to_svg_file(&self) -> String {
let mut result: Vec<String> = vec![format!(r#"<?xml version="1.0" encoding="UTF-8"?> let mut result: Vec<String> = vec![format!(r#"<?xml version="1.0" encoding="UTF-8"?>
<svg width="{}" height="{}"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="{}" height="{}">"#, self.width, self.height)];
"#, self.width, self.height)];
for patch in &self.patches { for patch in &self.patches {
let color = patch.color; let color = patch.color;