potracer
Python Potrace
What it is and what it does
Potracer is a pure Python implementation of Peter Selinger's Potrace, an algorithm for converting bitmap images into vector graphics by tracing their outlines. Unlike other Python bindings to Potrace such as pypotrace, this port avoids compilation and OS-specific installation issues by implementing the algorithm entirely in Python, making it compatible across platforms.
The library is designed as a drop-in replacement for pypotrace, so existing code using that library can often switch to potracer without modification. It depends only on numpy for bitmap handling. The trade-off is speed: being pure Python, it runs approximately 500x slower than the original C implementation, but remains practical for general use. An optional CLI extra is available for command-line tracing operations.
Use it for:
- Convert scanned documents or hand-drawn sketches to scalable vector formats without compilation hassles.
- Batch-process bitmap images to vectors in Python scripts where C dependencies are unavailable or problematic.
- Replace pypotrace in existing projects when installation or OS compatibility becomes an issue.
- Integrate image vectorization into cross-platform Python applications without native library dependencies.
- Trace logo artwork or simple graphics from raster sources for design workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts bitmap images to vector graphics by tracing outlines, implemented in pure Python as a port of Peter Selinger's Potrace algorithm.
Yes, if you need image vectorization and want to avoid compilation or OS-specific installation problems. The pure Python approach trades speed for universal compatibility. Maintenance is dormant but stable—no active development, but no known vulnerabilities and the repository remains unarchived. Suitable for general use unless you need production-grade performance on large batches.
Install
potracer on PyPI
pip
pip install potraceruv
uv add potracerpoetry
poetry add potracerInstalling potracer
Before you install
Low friction installation with a single runtime dependency (numpy). Dormant maintenance status—last release was in January 2022—but the repository remains active and unarchived with no known security vulnerabilities.
License in practice
Licensed under GPLv2+ (copyleft). Any derivative work or distribution must be released under compatible terms. The license also permits relicensing under Peter Selinger's original Potrace terms if those become more permissive.
Quickstart
pip install potracer
import potracer
# Trace a bitmap to vector paths
tracer = potracer.Potrace(bitmap_data)
vectors = tracer.trace()
Requires numpy for bitmap structures. Pure Python implementation is approximately 500x slower than the original C version.
Verify before relying
- Exact API compatibility with pypotrace and whether it truly functions as a drop-in replacement in all scenarios.
- Whether the optional CLI extra (potrace-cli) is actively maintained separately.
- Real-world performance characteristics and whether 500x slowdown is acceptable for your use case.
Package facts
| License | GPLv2+ (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | dormant — 1,661 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,080/month — #13,749 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: potracer-0.0.4-py2.py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
vtracerConverts raster images (JPG, PNG) into vector…
permissive · top 15,000 on PyPI
rlPyCairoA Cairo-based rendering backend plugin that…
permissive · top 5,000 on PyPI
svglibSvglib reads SVG files and converts them to…
copyleft · top 5,000 on PyPI
scourScour optimizes and cleans SVG files by…
permissive · top 15,000 on PyPI
dash-svgProvides SVG component primitives (Svg, G,…
permissive · top 15,000 on PyPI
svgwriteCreates SVG drawings programmatically by…
permissive · top 5,000 on PyPI
CairoSVGCairoSVG converts SVG files to PDF, EPS, PS,…
copyleft · top 5,000 on PyPI
vtkVTK is a 3D graphics, image processing, and…
permissive · top 5,000 on PyPI
winrt-Windows.Graphics.ImagingProvides Python bindings to Windows Runtime…
permissive · top 15,000 on PyPI
epaper-ditheringConverts images to dithered output optimized…
permissive · top 15,000 on PyPI