command-line reference

Documentation

Everything you need to trace a PNG into an SVG from the terminal. The command is potrace; point it at an image and it prints SVG.

Install

Prebuilt binary

Download the latest CI build, unpack, and put it on your PATH:

$ tar -xzf potrace-macos-arm64.tar.gz
$ ./potrace --input image.png --output image.svg

Usage

$ potrace --input <file.png> [--output <file.svg>] [options]

Core options

FlagDescriptionDefault
-i, --input <file> Input PNG file path. required
-o, --output <file> Output SVG file path. stdout
--invert Invert the input image colours before tracing. false
--turdsize <n> Suppress speckles whose area is at or below this many pixels². 2
--alphamax <n> Corner threshold. 0 keeps every corner crisp; 1.34 rounds everything. 1.0

Anti-aliasing options

Anti-aliasing softens 1-bit stair-stepping before tracing. Turn it on with --anti-alias; the rest only matter once it is enabled.

FlagDescriptionDefault
--anti-alias Smooth pixelated edges by anti-aliasing the bitmap before tracing. false
--anti-aliasing-algorithm <gaussian|supersample> Which anti-aliasing strategy to use. gaussian
--anti-alias-sigma <n> Gaussian blur sigma (≥ 0). 0.8
--anti-alias-kernel-size <n> Gaussian kernel size — odd and ≥ 3. 3
--anti-alias-threshold <n> Post-blur re-binarisation threshold in [0, 1]. 0.5
--anti-alias-supersample-factor <n> Supersampling factor — integer ≥ 2. 2

Example commands

Trace to a file

$ potrace --input image.png --output image.svg

Trace to stdout (pipe it)

$ potrace --input image.png > image.svg

Invert before tracing

$ potrace -i image.png -o image.svg --invert

Drop small speckles

$ potrace -i image.png -o image.svg --turdsize 8

Gaussian anti-aliasing

$ potrace -i image.png -o image.svg --anti-alias --anti-aliasing-algorithm gaussian

Supersample 4×

$ potrace -i image.png -o image.svg --anti-alias \
         --anti-aliasing-algorithm supersample --anti-alias-supersample-factor 4

Grab a build

Latest build v1.0.4-beta-3 · 27 Jun 2026

macOS (Apple Silicon)

potrace · arm64

517.5 KB
sha256 6e8b511c6278…

Download

Linux (x86_64)

potrace · x86_64

1.2 MB
sha256 44367ed53042…

Download