{"id":13558368,"url":"https://github.com/visioncortex/vtracer","last_synced_at":"2025-05-13T21:09:52.016Z","repository":{"id":37564952,"uuid":"306524806","full_name":"visioncortex/vtracer","owner":"visioncortex","description":"Raster to Vector Graphics Converter","archived":false,"fork":false,"pushed_at":"2024-09-27T09:43:47.000Z","size":35267,"stargazers_count":4192,"open_issues_count":10,"forks_count":295,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-04-28T17:06:05.816Z","etag":null,"topics":["image-procesing","rust","svg"],"latest_commit_sha":null,"homepage":"https://www.visioncortex.org/vtracer/","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/visioncortex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-23T03:58:35.000Z","updated_at":"2025-04-28T15:09:39.000Z","dependencies_parsed_at":"2024-03-29T19:35:06.261Z","dependency_job_id":"958b672c-6ef6-4eb2-b20b-a4a8f868ffe8","html_url":"https://github.com/visioncortex/vtracer","commit_stats":{"total_commits":74,"total_committers":7,"mean_commits":"10.571428571428571","dds":"0.14864864864864868","last_synced_commit":"971bffa948c0c2894d02b1d0293eaa40b00dd02c"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visioncortex%2Fvtracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visioncortex%2Fvtracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visioncortex%2Fvtracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visioncortex%2Fvtracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visioncortex","download_url":"https://codeload.github.com/visioncortex/vtracer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254029002,"owners_count":22002283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-procesing","rust","svg"],"created_at":"2024-08-01T12:04:54.899Z","updated_at":"2025-05-13T21:09:46.992Z","avatar_url":"https://github.com/visioncortex.png","language":"Rust","funding_links":[],"categories":["Rust","rust","置顶","Applications"],"sub_categories":["04、多媒体处理中心","Image processing"],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003cimg src=\"docs/images/visioncortex-banner.png\"\u003e\n  \u003ch1\u003eVTracer\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eRaster to Vector Graphics Converter built on top of visioncortex\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003ch3\u003e\n    \u003ca href=\"https://www.visioncortex.org/vtracer-docs\"\u003eArticle\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://www.visioncortex.org/vtracer/\"\u003eWeb App\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://github.com/visioncortex/vtracer/releases\"\u003eDownload\u003c/a\u003e\n  \u003c/h3\u003e\n\n  \u003csub\u003eBuilt with 🦀 by \u003ca href=\"https://www.visioncortex.org/\"\u003eThe Vision Cortex Research Group\u003c/a\u003e\u003c/sub\u003e\n\u003c/div\u003e\n\n## Introduction\n\nvisioncortex VTracer is an open source software to convert raster images (like jpg \u0026 png) into vector graphics (svg). It can vectorize graphics and photographs and trace the curves to output compact vector files.\n\nComparing to [Potrace](http://potrace.sourceforge.net/) which only accept binarized inputs (Black \u0026 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)`.\n\nComparing 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.\n\nVTracer 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.\n\nTechnical descriptions of the [tracing algorithm](https://www.visioncortex.org/vtracer-docs) and [clustering algorithm](https://www.visioncortex.org/impression-docs).\n\n## Web App\n\nVTracer and its [core library](//github.com/visioncortex/visioncortex) is implemented in [Rust](//www.rust-lang.org/). 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.\n\n![screenshot](docs/images/screenshot-01.png)\n\n![screenshot](docs/images/screenshot-02.png)\n\n## Cmd App\n\n```sh\nvisioncortex VTracer 0.6.0\nA cmd app to convert images into vector graphics.\n\nUSAGE:\n    vtracer [OPTIONS] --input \u003cinput\u003e --output \u003coutput\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n        --colormode \u003ccolor_mode\u003e                 True color image `color` (default) or Binary image `bw`\n    -p, --color_precision \u003ccolor_precision\u003e      Number of significant bits to use in an RGB channel\n    -c, --corner_threshold \u003ccorner_threshold\u003e    Minimum momentary angle (degree) to be considered a corner\n    -f, --filter_speckle \u003cfilter_speckle\u003e        Discard patches smaller than X px in size\n    -g, --gradient_step \u003cgradient_step\u003e          Color difference between gradient layers\n        --hierarchical \u003chierarchical\u003e\n            Hierarchical clustering `stacked` (default) or non-stacked `cutout`. Only applies to color mode.\n\n    -i, --input \u003cinput\u003e                          Path to input raster image\n    -m, --mode \u003cmode\u003e                            Curver fitting mode `pixel`, `polygon`, `spline`\n    -o, --output \u003coutput\u003e                        Path to output vector graphics\n        --path_precision \u003cpath_precision\u003e        Number of decimal places to use in path string\n        --preset \u003cpreset\u003e                        Use one of the preset configs `bw`, `poster`, `photo`\n    -l, --segment_length \u003csegment_length\u003e\n            Perform iterative subdivide smooth until all segments are shorter than this length\n\n    -s, --splice_threshold \u003csplice_threshold\u003e    Minimum angle displacement (degree) to splice a spline\n```\n\n## Downloads\n\nYou can download pre-built binaries from [Releases](https://github.com/visioncortex/vtracer/releases).\n\nYou can also install the program from source from [crates.io/vtracer](https://crates.io/crates/vtracer):\n\n```sh\ncargo install vtracer\n```\n\n\u003e You are strongly advised to not download from any other third-party sources \n\n### Usage\n\n```sh\n./vtracer --input input.jpg --output output.svg\n```\n\n### Rust Library\n\nYou can install [`vtracer`](https://crates.io/crates/vtracer) as a Rust library.\n\n```sh\ncargo add vtracer\n```\n\n### Python Library\n\nSince `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.\n\n```sh\npip install vtracer\n```\n\n## In the wild\n\nVTracer is used by the following products (open a PR to add yours):\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ca href=\"https://logo.aliyun.com/logo#/name\"\u003e\u003cimg src=\"docs/images/aliyun-logo.png\" width=\"250\"/\u003e\u003c/a\u003e\n      \u003cbr\u003eSmart logo design\n      \u003c/td\u003e\n      \u003ctd\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Citations\n\nVTracer 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:\n\n+ 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)\n+ arXiv 2023 [Image Vectorization: a Review](https://arxiv.org/abs/2306.06441)\n+ arXiv 2023 [StarVector: Generating Scalable Vector Graphics Code from Images](https://arxiv.org/abs/2312.11556)\n+ arXiv 2024 [Text-Based Reasoning About Vector Graphics](https://arxiv.org/abs/2404.06479)\n+ arXiv 2024 [Delving into LLMs' visual understanding ability using SVG to bridge image and text](https://openreview.net/pdf?id=pwlm6Po61I)\n\n## How did VTracer come about?\n\n\u003e The following content is an excerpt from my [unpublished memoir](https://github.com/visioncortex/memoir).\n\nAt my teenage, two open source projects in the vector graphics space inspired me the most: Potrace and Anti-Grain Geometry (AGG).\n\nMany years later, in 2020, I was developing a video processing engine. And it became evident that it requires way more investment to be commercially viable. So before abandoning the project, I wanted to publish *something* as open-source for posterity. At that time, I already developed a prototype vector graphics tracer. It can convert high-resolution scans of hand-drawn blueprints into vectors. But it can only process black and white images, and can only output polygons, not splines.\n\nThe plan was to fully develop the vectorizer: to handle color images and output splines. I recruited a very talented intern, [@shpun817](https://github.com/shpun817), to work on VTracer. I grafted the frontend of the video processing engine - the [\"The Clustering Algorithm\"](https://www.visioncortex.org/impression-docs#the-clustering-algorithm) as the pre-processor.\n\nThree months later, we published the first version on Reddit. Out of my surprise, the response of such an underwhelming project was overwhelming.\n\n## What's next?\n\nThere are several things in my mind:\n\n1. Path simplification. Implement a post-process filter to the output paths to further reduce the number of splines.\n\n2. Perfect cut-out mode. Right now in cut-out mode, the shapes do not share boundaries perfectly, but have seams.\n\n3. 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.\n\n4. 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.\n\nIf you are interested in working on them or willing to sponsor its development, feel free to get in touch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisioncortex%2Fvtracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisioncortex%2Fvtracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisioncortex%2Fvtracer/lists"}