vtracer  by visioncortex

Raster-to-vector graphics converter

created 4 years ago
4,548 stars

Top 11.0% on sourcepulse

GitHubView on GitHub
Project Summary

VTracer is an open-source raster-to-vector graphics converter designed to transform raster images (JPG, PNG) into scalable SVG files. It handles both graphics and photographs, offering a more compact output than tools like Adobe Illustrator's Image Trace by employing a stacking strategy and avoiding shapes with holes. VTracer is particularly suited for high-resolution scans of blueprints and can also process low-resolution pixel art.

How It Works

VTracer utilizes a Rust-based image processing pipeline that can handle colored, high-resolution scans, unlike Potrace which requires binarized input. Its core advantage lies in its O(n) complexity tracing algorithm, compared to Potrace's O(n^2) fitting algorithm. It offers various curve fitting modes (pixel, polygon, spline) and parameters for color precision, corner detection, speckle filtering, and gradient steps, allowing for fine-tuned vectorization.

Quick Start & Requirements

  • Install: cargo install vtracer or pip install vtracer
  • Prerequisites: Rust toolchain for source install. Python 3.x for pip install.
  • Usage: ./vtracer --input input.jpg --output output.svg
  • Documentation: visioncortex Article, Web App

Highlighted Details

  • O(n) complexity tracing algorithm, significantly faster than Potrace's O(n^2).
  • Handles color images and outputs compact vector files with fewer shapes.
  • Supports high-resolution scans (gigapixels) and pixel art.
  • Available as a Rust library, Python native extension, and pre-built binaries.

Maintenance & Community

  • Developed by The Vision Cortex Research Group.
  • Cited in several academic papers in computer graphics/vision research.
  • Roadmap includes path simplification, improved cut-out mode, pencil tracing, and image cleaning.

Licensing & Compatibility

  • License: MIT.
  • Compatible with commercial and closed-source projects.

Limitations & Caveats

  • The "cut-out mode" currently has seams where shapes do not perfectly share boundaries.
  • JPEG noise can impact tracing quality, suggesting a need for pre-filtering.
  • The project is actively seeking contributions and sponsorship for future development.
Health Check
Last commit

10 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
363 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.