mirror of
https://github.com/visioncortex/vtracer.git
synced 2025-12-07 01:26:12 -08:00
Compare commits
6 Commits
f6cf3e8705
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8acb6bd911 | ||
|
|
efa4351b2c | ||
|
|
a46292b5ed | ||
|
|
8889cbc7ea | ||
|
|
6b379a02ef | ||
|
|
2635d5b874 |
10
README.md
10
README.md
@@ -122,11 +122,13 @@ VTracer is used by the following products (open a PR to add yours):
|
|||||||
|
|
||||||
## Citations
|
## Citations
|
||||||
|
|
||||||
VTracer has since been cited in a few academic papers. Please kindly let us know if you have cited our work:
|
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:
|
||||||
|
|
||||||
+ [Framework to Vectorize Digital Artworks for Physical Fabrication based on Geometric Stylization Techniques](https://www.researchgate.net/publication/374448489_Framework_to_Vectorize_Digital_Artworks_for_Physical_Fabrication_based_on_Geometric_Stylization_Techniques)
|
+ SKILL 2023 [Framework to Vectorize Digital Artworks for Physical Fabrication based on Geometric Stylization Techniques](https://www.researchgate.net/publication/374448489_Framework_to_Vectorize_Digital_Artworks_for_Physical_Fabrication_based_on_Geometric_Stylization_Techniques)
|
||||||
+ [Image Vectorization: a Review](https://arxiv.org/pdf/2306.06441.pdf)
|
+ arXiv 2023 [Image Vectorization: a Review](https://arxiv.org/abs/2306.06441)
|
||||||
+ [StarVector: Generating Scalable Vector Graphics Code from Images](https://arxiv.org/abs/2312.11556)
|
+ arXiv 2023 [StarVector: Generating Scalable Vector Graphics Code from Images](https://arxiv.org/abs/2312.11556)
|
||||||
|
+ arXiv 2024 [Text-Based Reasoning About Vector Graphics](https://arxiv.org/abs/2404.06479)
|
||||||
|
+ arXiv 2024 [Delving into LLMs' visual understanding ability using SVG to bridge image and text](https://openreview.net/pdf?id=pwlm6Po61I)
|
||||||
|
|
||||||
## How did VTracer come about?
|
## How did VTracer come about?
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "vtracer"
|
name = "vtracer"
|
||||||
version = "0.6.4"
|
version = "0.6.5"
|
||||||
authors = ["Chris Tsang <chris.2y3@outlook.com>"]
|
authors = ["Chris Tsang <chris.2y3@outlook.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A cmd app to convert images into vector graphics."
|
description = "A cmd app to convert images into vector graphics."
|
||||||
@@ -14,11 +14,12 @@ keywords = ["svg", "computer-graphics"]
|
|||||||
clap = "2.33.3"
|
clap = "2.33.3"
|
||||||
image = "0.23.10"
|
image = "0.23.10"
|
||||||
visioncortex = { version = "0.8.8" }
|
visioncortex = { version = "0.8.8" }
|
||||||
fastrand = "1.8"
|
fastrand = { version = "2.3" }
|
||||||
pyo3 = { version = "0.19.0", optional = true }
|
pyo3 = { version = "0.19.0", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
python-binding = ["pyo3"]
|
python-binding = ["pyo3"]
|
||||||
|
wasm = ["fastrand/js"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "vtracer"
|
name = "vtracer"
|
||||||
|
|||||||
@@ -1,23 +1,27 @@
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use visioncortex::PathSimplifyMode;
|
use visioncortex::PathSimplifyMode;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub enum Preset {
|
pub enum Preset {
|
||||||
Bw,
|
Bw,
|
||||||
Poster,
|
Poster,
|
||||||
Photo,
|
Photo,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub enum ColorMode {
|
pub enum ColorMode {
|
||||||
Color,
|
Color,
|
||||||
Binary,
|
Binary,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub enum Hierarchical {
|
pub enum Hierarchical {
|
||||||
Stacked,
|
Stacked,
|
||||||
Cutout,
|
Cutout,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converter config
|
/// Converter config
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub color_mode: ColorMode,
|
pub color_mode: ColorMode,
|
||||||
pub hierarchical: Hierarchical,
|
pub hierarchical: Hierarchical,
|
||||||
@@ -32,6 +36,7 @@ pub struct Config {
|
|||||||
pub path_precision: Option<u32>,
|
pub path_precision: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub(crate) struct ConverterConfig {
|
pub(crate) struct ConverterConfig {
|
||||||
pub color_mode: ColorMode,
|
pub color_mode: ColorMode,
|
||||||
pub hierarchical: Hierarchical,
|
pub hierarchical: Hierarchical,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ fn find_unused_color_in_image(img: &ColorImage) -> Result<Color, String> {
|
|||||||
Color::new(0, 255, 255),
|
Color::new(0, 255, 255),
|
||||||
Color::new(255, 0, 255),
|
Color::new(255, 0, 255),
|
||||||
]);
|
]);
|
||||||
let rng = Rng::new();
|
let mut rng = Rng::new();
|
||||||
let random_colors =
|
let random_colors =
|
||||||
(0..NUM_UNUSED_COLOR_ITERATIONS).map(|_| Color::new(rng.u8(..), rng.u8(..), rng.u8(..)));
|
(0..NUM_UNUSED_COLOR_ITERATIONS).map(|_| Color::new(rng.u8(..), rng.u8(..), rng.u8(..)));
|
||||||
for color in special_colors.chain(random_colors) {
|
for color in special_colors.chain(random_colors) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
use visioncortex::{Color, CompoundPath, PointF64};
|
use visioncortex::{Color, CompoundPath, PointF64};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub struct SvgFile {
|
pub struct SvgFile {
|
||||||
pub paths: Vec<SvgPath>,
|
pub paths: Vec<SvgPath>,
|
||||||
pub width: usize,
|
pub width: usize,
|
||||||
@@ -8,6 +9,7 @@ pub struct SvgFile {
|
|||||||
pub path_precision: Option<u32>,
|
pub path_precision: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub struct SvgPath {
|
pub struct SvgPath {
|
||||||
pub path: CompoundPath,
|
pub path: CompoundPath,
|
||||||
pub color: Color,
|
pub color: Color,
|
||||||
|
|||||||
Reference in New Issue
Block a user