Rekha

Raster in. Clean SVG out.

Rekha traces PNG and JPEG logos, icons and artwork into compact SVG, and fits shading as real gradient fills instead of flat tiles. Run it in your browser, where your image never leaves your machine, or on the command line, from Go and as a service.

Free for open source under AGPL-3.0. Commercial licences for closed products.

A corner of the Rekha logo as pixels, enlarged eight times
The same corner traced by Rekha as smooth curves
PixelsSVG
Rekha's own logo at 8×: the PNG on the left, the traced SVG on the right. Drag to compare.

Side by side with other tracers

Three logos, each a 2048-pixel PNG, traced with each tool's default settings and rendered back at source size. PSNR is measured over the logo's own pixels, so higher is closer to the source and the transparent background counts for nothing. Fewer paths and bytes mean an SVG that is easier to edit and faster to load.

LogoToolPathsSizePSNR
Browser mark, radial shading and translucent layersRekha3332 kB34.8 dB
Adobe Express197325 kB28.7 dB
VTracer730 kB17.2 dB
Letter G, concentric rampsRekha1614 kB32.6 dB
Adobe Express4978 kB24.0 dB
VTracer1559 kB23.9 dB
Ball, flat colours and one highlightRekha54 kB33.3 dB
Adobe Express512 kB26.6 dB
VTracer720 kB30.5 dB

More traced logos, each with a wipe and its SVG to download, are in the gallery. Adobe Express is the commercial image-to-SVG tool, exported on 11 November 2026. VTracer 1.0.0-alpha.4 is the open-source colour tracer. Potrace, the classic open-source tracer, traces black and white only, so it has no result on colour art. Method and full figures: bench/results.

Browser mark globe, three panels: source, Rekha, Adobe Express. Rekha's shading is smooth; Adobe Express cuts it into flat cells.
Radial shading with translucent layers. Rekha fits one region as a base ramp under two radial layers. Adobe Express cuts it into flat cells.
Letter G logo, three panels: source, Rekha, Adobe Express. Rekha's rings shade smoothly; Adobe Express bands them.
Concentric ramps. Rekha fits one gradient per ring, plateau included. Adobe Express bands each ring.
Ball logo, three panels: source, Rekha, Adobe Express. The shapes agree.
Flat colours. The shapes agree, and Rekha's curves take a third of the bytes.

How it works

Rekha reduces the image to a few colours, finds the regions and fits each boundary with cubic curves that follow the anti-aliasing. Where neighbouring bands shade into each other it merges them and fits one gradient, linear or radial, with translucent layers on top for highlights and vignettes. The output is a small SVG that scales, edits and renders the same everywhere.

The same engine runs in the browser, on the command line, as a Go library and as an HTTP service. Pure Go, no cgo, one dependency.

Ways to use it

In the browser

Open the playground, drop an image, wipe between the source and the SVG, tune the controls and download. Everything runs in the page; nothing is uploaded.

On the command line

Download a binary for Linux, macOS, Windows or FreeBSD, install from the Homebrew tap, the Scoop bucket or the apt, dnf and apk repositories, or build with Go 1.26 or later. Then point it at an image. Each preset seeds every other setting; any flag you give overrides it. Output goes next to the input unless you say otherwise.

brew tap vexyl-ai/tap && brew trust vexyl-ai/tap && brew install --cask rekha   # macOS and Linux
sudo apt install rekha                           # Debian and Ubuntu, after adding the repo: vexyl-ai.github.io/packages
sudo dnf install rekha                           # Fedora and RHEL, same place
scoop install rekha                              # Windows, after adding the vexyl-ai bucket
go install github.com/vexyl-ai/rekha/cmd/rekha@latest

rekha logo.png                                   # black and white, writes logo.svg
rekha --preset poster --refine logo.png          # flat colours, refined curves
rekha --preset photo --gradients artwork.jpg     # smooth shading as gradient fills
rekha -o logo.pdf --preset poster logo.png       # PDF or EPS from the extension
rekha --preset poster --hierarchical cutout --stroke 0.5 logo.png
rekha -o out.svg --threshold auto scan.png       # automatic threshold, named output
rekha --mode polygon - < in.png > out.svg         # stdin to stdout, straight lines
rekha --help                                     # every flag, range and default

From Go

One call traces an image into paths and gradients; a second writes the SVG. Segmentation and curve fitting are separate steps, so a cached segmentation can be re-fitted with new curve options.

import "github.com/vexyl-ai/rekha"

o := rekha.PresetOptions(rekha.PresetPhoto)
o.Gradients = true
res, err := rekha.Trace(img, o)   // img is an image.Image
if err != nil {
    return err
}
err = res.WriteSVG(out, o)        // out is an io.Writer

As a service

The same binary that serves this site answers POST /v1/trace with an image and the CLI's options as form fields, with caps on size and time so one client cannot exhaust the host.

docker run --rm -p 8080:8080 ghcr.io/vexyl-ai/rekha   # or: go install github.com/vexyl-ai/rekha/cmd/rekha-serve@latest
curl -F image=@logo.png -F preset=poster -F refine=true localhost:8080/v1/trace > logo.svg

Full flag table, library documentation and the HTTP API are in the README and pkg.go.dev.

Who it's for

Designers

Rebuild a logo from the only copy left, a PNG, and get editable paths and gradients rather than a bitmap wrapped in an SVG. Try it in the playground, drop the background or a stray shape before you download; nothing is uploaded.

Developers

Call it from Go, run the CLI in a build step, load the WebAssembly module in a page or post an image to the HTTP endpoint. Every output is deterministic and covered by tests.

Companies

Put tracing inside your own product or service. A commercial licence lets you do that without opening your source, and it funds Rekha's development.

Free to use, paid to embed

Open source, AGPL-3.0

Use Rekha, change it and ship it at no cost, as long as what you ship stays open under the same licence, including when it is offered over a network. The source, the tests and the benchmarks are all on GitHub.