Rekha

What Rekha does to an image

Every feature below is in the open-source tracer and in the studio. Nothing about quality is held back for a paid plan.

7 flat paths1 path, 1 gradient

Gradient fills

Colour bands that follow one ramp are merged into a single region and filled by a multi-stop linear gradient, joined across bends, or by a radial gradient when the bands run round a centre. A region shaded more than one way, such as a sphere with an off-centre highlight, is painted in layers: a base gradient under up to two translucent radial gradients.

On a 16-megapixel illustration this took the trace from 155 flat paths to 82, raised the match to the source from 36.7 to 39.8 dB and cut the file by 60 %.

r4 arcs4 lines, 4 arcs

Geometric primitives

Circles become four exact arcs and ellipses four cubics. Rounded rectangles are four lines and four arcs with one shared radius; rotated rectangles are four nodes. Half-discs, pie wedges and concentric bands come out as arcs with corner ends, and a sharp corner is a single node.

The result edits cleanly in Illustrator, Figma or Inkscape, because it is built the way you would have built it.

edge placed inside the pixel

Curve refinement

Refinement optimises every Bézier against the anti-aliasing of the source image, so each edge is placed to a fraction of a pixel rather than to the nearest pixel corner.

On anti-aliased test images it adds 5 to 20 dB of PSNR at about the same number of nodes.

SVGPDFEPSDXFone trace, the same curves in each

SVG, PDF, EPS and DXF

One trace gives every format, written from the same curves and gradients. The PDF is a single page with axial and radial shadings and soft masks for translucent layers. The EPS is Level 3. The DXF is written from lines, arcs and circles in real units.

SVG, PDF and EPS are in the open-source build. DXF is in the studio and the commercial licence.

And the details that add up

Clean colour edges
Anti-aliased pixels between two colours are recognised as their mixture and absorbed, rather than surviving as slivers of a third colour.
Small objects keep their colour
A badge of a few hundred pixels, or a rim light, is too small to earn its own palette entry in most quantisers and turns grey. Rekha gives it an entry at its own colour.
Four presets and an automatic choice
Black and white for line art and scans, Poster for flat-colour artwork, Photo for soft shading, Flat for the posterised look. Auto traces the image four ways, renders each and keeps the one closest to the source.
Shared boundaries
The boundary between two shapes is fitted once, so neighbours carry identical coordinates. Stacked output layers shapes with no seams at all.
Small text survives
On a fixture of small glyphs Rekha reaches 32.26 dB with 86 nodes, against 32.22 dB with 107 nodes for Potrace.
Clean-up before the trace
In the studio, JPEG grain and rendering texture are measured and removed before tracing, so flat areas come out as one shape.
Fast and deterministic
A 3.4-megapixel logo traces in about a second on a laptop. The same input gives the same SVG on one core or eight, on arm64 or amd64.
Runs anywhere Go runs
A single static binary, an HTTP service with caps on size and time, or the browser through WebAssembly. No cgo, one dependency.

What it is not for

Rekha is built for artwork that was drawn: logos, icons, illustration, scans of line art. It will trace a photograph, but a photograph has no shapes to recover, so the result is a posterised picture rather than a cleaner file. Tracing also cannot invent detail that a small or blurry source never had. Start from the largest clean copy you can find.

See it on your own image

Drop a PNG or JPEG into the studio and download the SVG. No account needed for images up to 4 megapixels.