vtracer (Python)
Python bindings for vtracer. Built
with pyo3 + maturin; the core Rust
crate stays pure (no I/O), and this crate adds image decoding and a Pythonic API.
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, VTracer has an image processing pipeline which can handle colored images. VTracer skips Potrace's expensive optimal-polygon search in favor of a fast, linear pipeline that stays faithful to high-resolution images.
Comparing to Adobe Illustrator's Image Trace, VTracer's output is much more compact 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.
Technical descriptions of the tracing algorithm and clustering algorithm.
Install
pip install vtracer
Usage
import vtracer
# one-liners
vtracer.convert_file("in.png", "out.svg")
svg = vtracer.convert_bytes(open("in.png", "rb").read()) # -> str
svg = vtracer.convert_pixels(rgba_bytes, width, height) # raw RGBA8
# a rich, reusable configuration object
cfg = vtracer.Config(mode="polygon", filter_speckle=8)
cfg.hierarchical = "cutout" # seam-free mosaic
cfg.palette = ["#1b1b1b", "#e0c088", "#5a7d3c"] # snap to a fixed palette
cfg.max_colors = 8 # or auto-quantize
cfg.optimize = 2
svg = cfg.convert_bytes(data)
# presets
vtracer.Config.poster().convert_file("photo.jpg", "poster.svg")
vtracer.Config.bw().convert_file("scan.png", "lineart.svg")
Config
Constructor keyword arguments (all optional) — also exposed as mutable
properties, plus the presets Config.bw(), Config.poster(), Config.photo():
| arg | default | notes |
|---|---|---|
clustering |
"color-cluster" |
"color-cluster", "bw", or "watershed" |
hierarchical |
"stacked" |
"stacked" or "cutout" (mosaic) |
mode |
"spline" |
"pixel", "polygon", "spline" |
filter_speckle |
4 |
discard patches smaller than X px |
color_precision |
6 |
significant bits per channel |
layer_difference |
16 |
color diff between gradient layers |
corner_threshold |
60 |
degrees |
length_threshold |
4.0 |
px |
max_iterations |
10 |
|
splice_threshold |
45 |
degrees |
simplify |
None |
curve simplification tolerance in px (try 1–2.5) |
path_precision |
2 |
output decimal places |
palette |
None |
list of #rrggbb strings |
max_colors |
None |
auto-quantize target |
optimize |
1 |
0 off, 1 quantize+cleanup, 2 + shorthands |
binary_threshold |
128 |
bw: fixed cutoff, foreground below it |
adaptive |
False |
bw: Bradley–Roth adaptive thresholding |
adaptive_window |
0 |
bw adaptive: window px (0 = auto) |
adaptive_t |
15.0 |
bw adaptive: % below local mean |
watershed_detail |
128 |
watershed: hierarchy cut level (higher = more regions, uncapped) |
Each Config has convert_file(input, output), convert_bytes(data, format=None) -> str,
and convert_pixels(rgba, width, height) -> str.
Build from source
maturin develop # into the active virtualenv
maturin build --release # produce a wheel
Metadata
Release files for vtracer 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vtracer-1.0.0.tar.gz | 109.2 kB | Without provenance | Details for vtracer-1.0.0.tar.gz |
Built distributions (wheels)
Total release size: 18.7 MB
Release files / vtracer-1.0.0.tar.gz
| Download URL | vtracer-1.0.0.tar.gz |
|---|---|
| Size | 109.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45f349f4e606a5f3c175d3793a02689b2bb2b3e424bbcf5ec1d57cb5e7346bc1
|
|
BLAKE2b-256 checksum How to use checksums |
268178bebb9ef03d297fc3b704d853deaf95a5e58d1fdc95591b66850b14eafa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-win_arm64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-win_arm64.whl |
|---|---|
| Size | 932.0 kB |
| Tags | CPython 3.8 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ab1fe0463b3976de345fb38c7dfca440c7477f1e54620f7298dc5f511accef33
|
|
BLAKE2b-256 checksum How to use checksums |
a69831bae5311569cacd9a241b33fd92a15d99dafb97b39f87e6951f19488240
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-win_amd64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 985.3 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
50b018932505266d6e16dc1b547ace3eddb0aded11f63ae72bac2e210b4308e7
|
|
BLAKE2b-256 checksum How to use checksums |
1350c622756b3545693bba2d7a06c9c6db473a3c5d2ac4b44d7d18c6f33b0707
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-win32.whl
| Download URL | vtracer-1.0.0-cp38-abi3-win32.whl |
|---|---|
| Size | 960.4 kB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
17c164d43c00a1cc1258a0fbf60aa76b1318ea4cb11be2c1d81746620fb216c3
|
|
BLAKE2b-256 checksum How to use checksums |
1e3c98a30f42c4168e49dfdacbc1a85bf7ce2920f997927ea3cb2eb2d7b6916f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c74f908e3c2a8581299ac913d9020aa8f7d9886a0cc922b401135ef7b8c5f8ff
|
|
BLAKE2b-256 checksum How to use checksums |
758567bd8c8f4a09442fe8534902f6079e371823d05f7c1a66c437db2c6fba44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | vtracer-1.0.0-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
21fffa93124f420285ff1093719251f241e891fc7bcd1a4ea78604745c29012d
|
|
BLAKE2b-256 checksum How to use checksums |
26936c7a77e2472b1527f36d8f43794a5502aa3f07bc62916b00e1f478e5120a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-musllinux_1_2_armv7l.whl
| Download URL | vtracer-1.0.0-cp38-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
aef43b51b15a8e1bff334fc45b4946a40417e930d9002972992db97392d11e27
|
|
BLAKE2b-256 checksum How to use checksums |
9a0819bf752cce74dc6cd542936c97a2b14d72a86f554dc7bd3908ce413ec504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e797e4e0eec8423fb745b918148b941055526922945089ff15ca16322d18c69b
|
|
BLAKE2b-256 checksum How to use checksums |
9c33885d5c180816f69dbf6b4be4ad27d4de2419814b42cf2559c39edb43d3b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4f7bef8c056d55e1ea817d16f96172eb6b2e11829cede04ecdd9bbcb6081a770
|
|
BLAKE2b-256 checksum How to use checksums |
5ee156888e86a6f4bb5fddae4f9537fba5588d00710e35667f46241613773c6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl
| Download URL | vtracer-1.0.0-cp38-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ IBM System/390x abi3 |
|
SHA-256 checksum How to use checksums |
eb5dbbdb4945e0ec55f828f1c0eaa1b5d8c79b2673e5016bccc9888706494771
|
|
BLAKE2b-256 checksum How to use checksums |
8d74e3ed51c974790dc7a6f1c9e74013cea3b2520237d1003dc161cb2058b6b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl
| Download URL | vtracer-1.0.0-cp38-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ PowerPC 64-le abi3 |
|
SHA-256 checksum How to use checksums |
575ffc078bb7cc159aaddce0c8f42094ffc6a1be199b9aae6b46d52e3b3a4513
|
|
BLAKE2b-256 checksum How to use checksums |
760f0d9d0244c42a1b619c81e2f27468eac567e6bc8c23ae409fa8ffa8938b96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
| Download URL | vtracer-1.0.0-cp38-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
2915f83f8ea3458cf7ac8b87ee0297d90b511d8ef9d73495d49d0141c5215089
|
|
BLAKE2b-256 checksum How to use checksums |
52a946b362fd6aeba8c2381750c39a8f7ab2d3e289d947aa2b08aa67f576eccb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c1b7f5848cce2701773a7d0c887fae9ec2670e607128826489c3ba6faedbeec2
|
|
BLAKE2b-256 checksum How to use checksums |
9d7ce90934124b0dc3d4a29b2fb4709fc8bfa903eaab59f13de953ee99d0956b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-manylinux1_i686.manylinux_2_5_i686.whl
| Download URL | vtracer-1.0.0-cp38-abi3-manylinux1_i686.manylinux_2_5_i686.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
80c67473b8f5dc95841e1f8d7bd0ca92c47979ba7a86eb0aedd7d35a344251f2
|
|
BLAKE2b-256 checksum How to use checksums |
3a89a7c7f2f7bbf3ea6a7e608858ee26f9fec51cc082f59c168d622d2be65d98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
740d8a92212ac73f3ef9fa376157b4807fab3f564a29cfc8dfe57b126e9a9d8c
|
|
BLAKE2b-256 checksum How to use checksums |
90c5938097e0dd7a94c4bbd2bcd038092972841c0de0e85bbaff08cf80973126
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / vtracer-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | vtracer-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c782c0d82448cb366d592523924e3695c4e6318a53958cb9b6490d56061c8c75
|
|
BLAKE2b-256 checksum How to use checksums |
c2d10ec201754e3d87bccce2d46071b32d29e154e7c56d3b3f9b82fa77c3d994
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for vtracer 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.