rekha

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

README

Rekha

Rekha

Raster to clean SVG. Pure Go. Your image never leaves your machine.
Try it in your browser

CI Go Reference AGPL-3.0 Commercial licence available Go 1.26 Playground

Rekha converts raster images (PNG, JPEG, GIF) into editable SVG. One codebase provides a Go library, a command-line tool, an HTTP service and a WebAssembly build for the browser. It has no cgo and no dependency beyond golang.org/x/image, and it is a clean-room implementation, dual-licensed: AGPL-3.0 for open source, a commercial licence for everything else.

Contents

Features

  • Curve refinement. --refine optimises every Bézier against the image's anti-aliasing (after Yang et al., 2016), placing edges to a fraction of a pixel. On anti-aliased test images this adds 5–20 dB PSNR at about the same node count.
  • Geometric primitives. Circles become four exact arcs, rounded rectangles four lines and four arcs with one shared radius, rotated rectangles four nodes. The result edits cleanly in Illustrator, Figma or Inkscape.
  • Gradient fills. --gradients merges colour bands that follow one ramp into a single region filled by a multi-stop <linearGradient>, joined across bends, or by a <radialGradient> when the bands run round a centre, with specks inside a ramp absorbed. A region shaded more than one way (a sphere with an off-centre highlight, a rim light) is painted in layers: a base gradient under up to two translucent radial gradients that fade by stop-opacity, as an illustrator draws it. A 16-megapixel illustration drops from 155 flat paths at 36.7 dB to 82 paths at 39.8 dB with 60 % fewer bytes; flat art is byte-identical with the option on.
  • 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.
  • Three presets. bw for line art and scans, poster for flat-colour artwork, photo for photographs and soft shading. Every parameter can be overridden.
  • Shared boundaries. Cutout output fits each boundary between two shapes once, so neighbours carry identical coordinates; stacked output layers shapes with no seams. --stroke seals hairline seams in either mode.
  • Small text survives. On the small-glyphs fixture Rekha reaches 32.26 dB with 86 nodes against Potrace's 32.22 dB with 107.
  • Fast and deterministic. 0.1–0.25 s per 256×256 image with refinement; 1.1 s plain or 4.6 s refined for a 3.4-megapixel logo on a laptop. The same input gives the same SVG on one core or eight, arm64 or amd64.
  • Progress reporting. The library reports each stage and its count through a callback; the WebAssembly API and the demo page expose the same.
  • Runs anywhere Go runs. A single static binary, a capped HTTP service, or the browser via WebAssembly: images traced in the browser are never uploaded.

Installation

brew install --cask vexyl-ai/tap/rekha          # macOS and Linux, Homebrew
scoop bucket add vexyl-ai https://github.com/vexyl-ai/scoop-bucket && scoop install rekha   # Windows
docker run --rm -p 8080:8080 ghcr.io/vexyl-ai/rekha   # HTTP API in a container

Prebuilt binaries for Linux, macOS, Windows and FreeBSD (amd64 and arm64) are on the releases page, as archives and as .deb, .rpm, .apk and Arch packages. Each archive holds rekha and rekha-serve; unpack and put them on your PATH.

sudo dpkg -i rekha_*_linux_amd64.deb        # Debian, Ubuntu
sudo rpm -i rekha_*_linux_amd64.rpm         # Fedora, RHEL, openSUSE
sudo apk add --allow-untrusted rekha_*_linux_amd64.apk   # Alpine
sudo pacman -U rekha_*_linux_amd64.pkg.tar.zst           # Arch

macOS may refuse an unsigned downloaded binary on first run; xattr -d com.apple.quarantine rekha clears that.

With Go 1.26 or later:

go install github.com/vexyl-ai/rekha/cmd/rekha@latest

Or from a checkout:

git clone https://github.com/vexyl-ai/rekha.git
cd rekha
make build        # bin/rekha and bin/rekha-serve
make test         # unit tests and goldens

Releases are built by .github/workflows/release.yml with GoReleaser when a v* tag is pushed: binaries, packages, the Homebrew cask in vexyl-ai/homebrew-tap, the Scoop manifest in vexyl-ai/scoop-bucket and the image at ghcr.io/vexyl-ai/rekha. make release-check builds the binaries and packages into dist/ locally.

Quick start

rekha image.png                                   # writes image.svg
rekha -o out.svg --threshold auto scan.png        # black and white, automatic threshold
rekha --preset poster logo.png                    # flat colours, stacked layers
rekha --preset poster --refine logo.png           # plus curve refinement and primitives
rekha --preset photo --gradients artwork.jpg      # smooth shading as gradient fills
rekha --preset poster --palette "#000000,#ff0000,#ffffff" logo.png
rekha --preset poster --hierarchical cutout --stroke 0.5 logo.png
rekha --mode polygon - < in.png > out.svg         # stdin to stdout

Exit codes: 0 success, 1 usage error, 2 a trace failed (remaining inputs are still processed).

Options

--preset bw|poster|photo seeds every default; any flag given on the command line overrides it.

Colour

Flag Default Description
--threshold 0..1|auto 0.5 bw only: cut-off between black and white; auto uses Otsu's method
--turn-policy minority bw only: how a 2×2 checkerboard connects (minority, majority, black, white)
--color-tolerance 0..1 0.08 / 0.04 OKLab distance at which colours merge (poster / photo)
--max-colors N 0 Palette cap; 0 lets the tolerance decide
--palette "#rrggbb,…" Fixed palette, up to 256 entries
--color-precision N 6 Bits per channel in the quantiser
--filter-speckle N 4 / 16 Drop components below N pixels (poster / photo)
--gradients off Colour presets: merge bands that follow one ramp into a <linearGradient> fill, a <radialGradient> when they run round a centre, or a base gradient under translucent layers (radial or linear, fading either way) when the region is shaded more than one way
--gradient-tolerance 0..1 0.03 RMS error a ramp may leave, in sRGB units (about 8/255)

Curves

Flag Default Description
--mode pixel|polygon|spline spline Output geometry
--simplify px 0.75 Polygon simplification tolerance
--corner-threshold deg 60 Angle above which a vertex is a corner
--fit-tolerance px 1.0 / 1.5 Maximum curve error in the plain fit (bw,poster / photo)
--refine off Optimise curves against the anti-aliasing; replaces recognised circles, arcs, shared radii and rectangles when the rendered error rises by no more than 2 %
--refine-passes N 3 Optimiser sweeps (1–10)

Output

Flag Default Description
--hierarchical stacked|cutout cutout / stacked Shapes with holes sharing one boundary curve, or layered shapes (bw / colour presets)
--stroke px 0 Stroke each shape in its own fill to seal hairline seams when viewed enlarged (0–4; --cutout-stroke is accepted as an alias)
--path-precision N 2 Decimals in path data
--no-mark off Leave out the generator mark: by default the root carries data-generator="rekha <version>" and a comment names Rekha and this repository; neither changes how the image renders
-o, --output <input>.svg Output file, or - for stdout

In stacked output the white page is omitted (near-white shapes at depth 0 holding at least half the depth-0 area), so transparent input stays transparent.

Library

package main

import (
	"image/png"
	"os"

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

func main() {
	f, _ := os.Open("logo.png")
	img, _ := png.Decode(f)

	o := rekha.PresetOptions(rekha.PresetPoster)
	o.Refine.Enabled = true
	o.Progress = func(stage string, done, total int) { /* quantise, label, …, curves */ }

	res, err := rekha.Trace(img, o)
	if err != nil {
		panic(err)
	}
	out, _ := os.Create("logo.svg")
	defer out.Close()
	res.WriteSVG(out, o)
}

Segment and Finish split the work so a cached segmentation can be re-fitted with new curve options; TraceReader decodes PNG, JPEG or GIF from an io.Reader. See the package documentation.

Browser and WebAssembly

The playground is hosted at vexyl-ai.github.io/rekha/demo behind the product page at vexyl-ai.github.io/rekha, both rebuilt from main by .github/workflows/pages.yml on every push. To run it locally:

make serve      # builds web/demo/rekha.wasm and serves the site on http://localhost:8080/ (playground at /demo/)

The demo page traces entirely in a Web Worker: drop, paste or choose an image, adjust the controls, compare source and SVG with a wipe, zoom and pan the canvas (ctrl/⌘ + wheel or pinch, drag, double-click, toolbar, keys + - 0 1), watch the progress bar, and download the SVG. Nothing is uploaded.

The WebAssembly module exposes segment, finish, trace and free on a global rekha object, each with an optional progress callback. The API, worker protocol and embedding notes are in docs/wasm.md.

HTTP API

go run ./cmd/rekha-serve -static web
curl -F image=@logo.png -F preset=poster -F refine=true localhost:8080/v1/trace > logo.svg

POST /v1/trace accepts multipart or a raw image/* body with options as fields or query parameters, and returns image/svg+xml. The server caps request bytes, decoded pixels, wall time, concurrency and queue length. Details in docs/server.md.

Quality and benchmarks

All numbers in this file are produced by make test and make bench; fixtures and commands are in the repository.

Case Result
Anti-aliased synthetics, --refine +5–20 dB PSNR over the plain fit at about the same node count
Small glyphs 32.26 dB, 86 nodes (Potrace: 32.22 dB, 107 nodes)
3.4-megapixel colour logo, --preset poster 14 paths; PSNR level with VTracer (28.95 vs 28.98 dB), white counters kept white
16-megapixel illustration, --preset photo --gradients 155 → 82 paths, 36.7 → 39.8 dB, 60 % fewer bytes
4-megapixel browser mark, --preset photo --gradients 33 paths at 36.3 dB with layered gradients (flat bands: 31 paths at 34.5 dB), half the bytes; the globe one smooth region, seams between gradients smooth
WebAssembly median 4.5× one-core native; 1.2 MB gzipped

Recorded baselines: bench/results/. Methodology and reference-tool comparison: docs/benchmark.md.

Compared with Adobe Express

Three logos, each a 2048-pixel PNG with a transparent background, traced by Rekha (--preset photo --gradients, defaults otherwise) and converted by Adobe Express's image-to-SVG tool (export of 2026-11-11). Both outputs are rendered back at the source size with librsvg and scored against the source over the logo's opaque pixels, so neither tool is charged for how it treats the transparent background. Higher PSNR is closer to the source.

Logo Rekha Adobe Express
Browser mark (radial shading, translucent layers) 33 paths, 32 kB, 34.8 dB 197 paths, 325 kB, 28.7 dB
Letter G (concentric ramps) 16 paths, 14 kB, 32.6 dB 49 paths, 78 kB, 24.0 dB
Ball (flat colours, one highlight) 5 paths, 4 kB, 33.3 dB 5 paths, 12 kB, 26.6 dB

Rekha fits shading as SVG gradients (13 on the browser mark); Adobe Express cuts shading into flat cells, which shows as tiling on anything that fades and multiplies the paths and bytes. On flat art the two agree on the shapes and differ in curve economy.

Numbers and strips: bench/results/2026-11-11-adobe-express.md. Vector Magic and Vectorizer.AI are scored the same way when their outputs are placed under bench/reference/ (see docs/benchmark.md).

Limitations

  • Photographs posterise into colour bands; --gradients smooths shading that runs along one direction, out from one centre, or in up to two translucent layers over a base, but shading with more structure than that (a third light, a texture) stays banded. An AI pre-pass is planned (roadmap phase 6).
  • Cutout output shares boundaries exactly, yet most viewers anti-alias each shape separately and let the page show faintly through shared edges at 1:1. Stacked output is therefore the default.
  • Comparisons against Vector Magic and Vectorizer.AI are produced only when their outputs are placed under bench/reference/ (see docs/benchmark.md).

Provenance

Rekha is written from published algorithms, not from existing tracer code:

  • Pipeline design after VTracer's published linear pipeline (MIT / Apache-2.0).
  • Curve fitting after Schneider, An Algorithm for Automatically Fitting Digitized Curves, Graphics Gems, 1990.
  • Refinement after Yang et al., Effective Clipart Image Vectorization Through Direct Optimization of Bezigons, IEEE TVCG 2016.

It contains no code derived from Potrace or any other GPL-licensed tracer; Potrace and VTracer are used only as black-box binaries in the benchmark harness. The clean-room rule is in CONTRIBUTING.md. Every commit carries a DCO sign-off.

Documentation

Author

Rekha is written and maintained by Anil Mathew (LinkedIn).

Package documentation: pkg.go.dev/github.com/vexyl-ai/rekha.

Licence

Dual-licensed.

  • AGPL-3.0 for open source: free to use, change, ship and host, provided what you build with it is released under the AGPL-3.0 too. See LICENSE and NOTICE.
  • Commercial licence for products, services and internal tools that will not release their source. It funds the development of the open version. See COMMERCIAL.md.

Versions published before this change (up to commit fe2e104) remain under the Apache License 2.0 they were released with.

Documentation

Overview

Package rekha traces raster images into SVG.

Index

Constants

View Source
const (
	TurnMinority = contour.Minority
	TurnMajority = contour.Majority
	TurnBlack    = contour.Black
	TurnWhite    = contour.White
)

Turn policies.

Variables

This section is empty.

Functions

func Version

func Version() string

Version is the module version this binary was built from, as Go records it: a tag such as v1.2.0 when installed with go install, or "dev" from a source checkout or when the build carries no version.

Types

type Hierarchical

type Hierarchical string

Hierarchical selects how colour shapes are layered in the output.

const (
	// HierarchicalStacked paints every shape's outer contour, larger and
	// deeper shapes first, so each one covers what it encloses: no holes,
	// no seams between abutting colours.
	HierarchicalStacked Hierarchical = "stacked"
	// HierarchicalCutout paints each shape with its holes cut out, as
	// Phase 1 does for black on white.
	HierarchicalCutout Hierarchical = "cutout"
)

Layering modes.

type Mode

type Mode string

Mode selects the output geometry.

const (
	ModePixel   Mode = "pixel"
	ModePolygon Mode = "polygon"
	ModeSpline  Mode = "spline"
)

Output modes.

type Options

type Options struct {
	Preset         Preset
	Mode           Mode
	FilterSpeckle  int // pixels; 0..1024
	ColorPrecision int // bits; 1..8
	PathPrecision  int // decimals; 0..8
	MaxColors      int // palette cap; 0 = as many as ColorTolerance needs, up to 256

	Threshold         float64    // 0..1; pixels darker than this are foreground
	AutoThreshold     bool       // choose Threshold with Otsu's method
	TurnPolicy        TurnPolicy // checkerboard resolution
	SimplifyTolerance float64    // px; 0..10
	CornerThreshold   float64    // degrees; 0..180
	FitTolerance      float64    // px; 0.01..10

	ColorTolerance float64       // OKLab distance 0..1 at which colours merge (white to black is 1)
	Palette        []color.NRGBA // fixed palette, at most 256 distinct entries; empty = quantise
	Hierarchical   Hierarchical

	Refine RefineOptions // spline mode only
	Stroke float64       // px, 0..4, default 0; polygon/spline colour shapes are stroked in their fill to hide hairline seams between fitted edges when viewed enlarged
	// Deprecated: use Stroke. CutoutStroke is read when Stroke is 0.
	CutoutStroke float64

	Gradients         bool    // colour presets: merge adjacent bands that form one linear ramp into a gradient fill
	GradientTolerance float64 // 0..1, default 0.03; RMS sRGB distance (channels 0..1) a ramp may leave

	// NoMark leaves out the generator mark: by default the SVG root
	// carries data-generator="rekha <version>" and a comment naming
	// Rekha and its repository. Neither changes how the image renders.
	NoMark bool

	// Progress, when set, is told how far Segment and Finish have got:
	// stage names quantise, label, ramps (Segment; no count) and
	// outlines, nest, edges, refine, curves (Finish; done of total, total
	// 0 when a stage has no count). Under parallel work it may be called from several
	// goroutines at once and counts may arrive out of order. It must be
	// quick: a stage reports at most once per whole percent.
	Progress Progress
}

Options controls a trace. One struct backs the CLI, the HTTP API and the WebAssembly entry point; Validate is the single source of truth for ranges.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the bw/spline defaults, PresetOptions(PresetBW).

func PresetOptions

func PresetOptions(p Preset) Options

PresetOptions returns the defaults for preset p. An unknown preset returns the bw defaults with Preset set to p, which Validate rejects.

func (Options) Validate

func (o Options) Validate() error

type Preset

type Preset string

Preset selects a named bundle of defaults.

const (
	PresetBW     Preset = "bw"
	PresetPoster Preset = "poster"
	PresetPhoto  Preset = "photo"
)

Presets.

type Progress

type Progress func(stage string, done, total int)

Validate checks every field in struct order and returns the first failure as a *ValidationError, or nil. Progress receives Options.Progress reports.

type RefineOptions

type RefineOptions struct {
	Enabled    bool
	Sweeps     int            // 1..10; passes over the contour's pieces
	MaxIter    int            // 1..200; L-BFGS iterations per piece
	Weights    refine.Weights // prior weights, finite and non-negative
	MergeSplit bool           // merge smooth joints, split bad fits
	Primitives bool           // replace near-circles by exact circles
}

RefineOptions controls the Phase 3 refinement of spline output: each fitted contour is optimised against the input's anti-aliasing (Yang et al. 2016), its segments merged and split, and circles recognised.

type Result

type Result struct {
	Width, Height int
	Gradients     []svg.LinearGradient
	Radials       []svg.RadialGradient
	Paths         []svg.Path
}

Result is a traced image: filled paths in pixel coordinates, and the gradients (Options.Gradients) that some of them are filled with.

func Trace

func Trace(img image.Image, o Options) (*Result, error)

Trace vectorises img according to o.

func TraceReader

func TraceReader(r io.Reader, o Options) (*Result, error)

TraceReader decodes an image (PNG, JPEG or GIF) and traces it.

func (*Result) WriteSVG

func (r *Result) WriteSVG(w io.Writer, o Options) error

WriteSVG writes r as an SVG document with o.PathPrecision decimals, marked with Rekha's name and version unless o.NoMark is set.

type Segmentation

type Segmentation struct {
	Width, Height int
	Palette       []color.NRGBA // final palette after cleanup; bw: {white, black}
	Labels        []uint8       // palette index per pixel
	Second        []uint8       // second-nearest palette index per pixel
	Blend         []uint8       // 128..255, share of Labels' colour in the pixel
	// Ramps, when Options.Gradients merged bands, has one entry per
	// palette index: the linear ramp that fills it, or nil for a flat
	// colour. Nil altogether when no option asked for ramps.
	Ramps []*gradient.Ramp
	// contains filtered or unexported fields
}

Segmentation is an image reduced to a palette and a label per pixel: the input to Finish, and the hand-off point for callers that quantise themselves.

func Segment

func Segment(img image.Image, o Options) (*Segmentation, error)

Segment reduces img to a Segmentation under o. The bw preset thresholds grey exactly as Phase 1 and labels foreground 1 on a {white, black} palette; the colour presets quantise in OKLab (or snap to o.Palette), then despeckle, absorb anti-aliasing slivers and compact the palette.

func (*Segmentation) Finish

func (s *Segmentation) Finish(o Options) (*Result, error)

Finish traces every colour of s, orders the shapes (stacked: nesting depth, outer contours only, consecutive paths of one colour sharing a <path>; cutout: colour then scan order, holes cut out, one path per shape), fits each contour under o.Mode and returns the paths with their palette fills. White shapes at depth 0 are left out.

type TurnPolicy

type TurnPolicy = contour.TurnPolicy

TurnPolicy decides how a boundary walk resolves a 2×2 checkerboard.

type ValidationError

type ValidationError struct {
	Field string
	Msg   string
}

ValidationError reports the first invalid field.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Directories

Path Synopsis
cmd
rekha command
Command rekha traces raster images into SVG.
Command rekha traces raster images into SVG.
rekha-bench command
Command rekha-bench runs reference tracers over the corpus and scores them.
Command rekha-bench runs reference tracers over the corpus and scores them.
rekha-serve command
Command rekha-serve is an HTTP front for Rekha: POST /v1/trace returns an SVG; caps on bytes, pixels, time, concurrency and queue keep one client from exhausting the host.
Command rekha-serve is an HTTP front for Rekha: POST /v1/trace returns an SVG; caps on bytes, pixels, time, concurrency and queue keep one client from exhausting the host.
rekha-wasm command
Command rekha-wasm is the WebAssembly build of Rekha: it installs a global "rekha" object with segment, finish, free, trace and version.
Command rekha-wasm is the WebAssembly build of Rekha: it installs a global "rekha" object with segment, finish, free, trace and version.
internal
apiopts
Package apiopts turns the option fields of the WebAssembly and HTTP entry points into rekha.Options: a JSON object (wasm) or string fields (HTTP form or query), seeded by the preset exactly as the CLI does.
Package apiopts turns the option fields of the WebAssembly and HTTP entry points into rekha.Options: a JSON object (wasm) or string fields (HTTP form or query), seeded by the preset exactly as the CLI does.
bench
Package bench runs external tracers as black boxes over a corpus and scores their SVG output against the input pixels.
Package bench runs external tracers as black boxes over a corpus and scores their SVG output against the input pixels.
bitmap
Package bitmap holds a packed 1-bit image and the grey/threshold steps that produce it from a decoded picture.
Package bitmap holds a packed 1-bit image and the grey/threshold steps that produce it from a decoded picture.
cli
Package cli holds helpers shared by the rekha command-line entry point.
Package cli holds helpers shared by the rekha command-line entry point.
colour
Package colour converts sRGB to the OKLab perceptual colour space, in which the quantiser measures colour differences.
Package colour converts sRGB to the OKLab perceptual colour space, in which the quantiser measures colour differences.
contour
Package contour walks the boundaries between foreground and background pixels along pixel edges ("cracks") and groups the resulting loops into shapes with holes.
Package contour walks the boundaries between foreground and background pixels along pixel edges ("cracks") and groups the resulting loops into shapes with holes.
corpus
Package corpus generates the deterministic synthetic test images used by the benchmark harness.
Package corpus generates the deterministic synthetic test images used by the benchmark harness.
corpus/gen command
Command gen writes the synthetic corpus as PNG files.
Command gen writes the synthetic corpus as PNG files.
fit
Package fit turns dense boundary points into cubic Bézier segments using the least-squares scheme described by Schneider in Graphics Gems (1990).
Package fit turns dense boundary points into cubic Bézier segments using the least-squares scheme described by Schneider in Graphics Gems (1990).
geom
Package geom holds the lattice and vector primitives shared by the contour, simplification and fitting stages.
Package geom holds the lattice and vector primitives shared by the contour, simplification and fitting stages.
gradient
Package gradient merges adjacent quantised colour bands that together form one linear colour ramp, and fits each merged region a two-stop linear gradient in pixel coordinates.
Package gradient merges adjacent quantised colour bands that together form one linear colour ramp, and fits each merged region a two-stop linear gradient in pixel coordinates.
latency
Package latency times Segment and Finish per preset over a directory of images and prints a markdown table; the same code runs natively and under WebAssembly (go_js_wasm_exec maps os to Node's fs), so the two tables compare like for like.
Package latency times Segment and Finish per preset over a directory of images and prints a markdown table; the same code runs natively and under WebAssembly (go_js_wasm_exec maps os to Node's fs), so the two tables compare like for like.
metrics
Package metrics scores traced output: pixel fidelity and SVG size.
Package metrics scores traced output: pixel fidelity and SVG size.
par
Package par runs independent work items on GOMAXPROCS workers.
Package par runs independent work items on GOMAXPROCS workers.
planar
Package planar builds the shared-boundary map of a label image: the crack loops of every colour, cut at the vertices where three colours meet (or two meet diagonally) into arcs, each arc shared by the two regions on its sides.
Package planar builds the shared-boundary map of a label image: the crack loops of every colour, cut at the vertices where three colours meet (or two meet diagonally) into arcs, each arc shared by the two regions on its sides.
quant
Package quant builds a colour palette for an image and maps its pixels onto it.
Package quant builds a colour palette for an image and maps its pixels onto it.
rasttest
Package rasttest is a test-only nonzero-winding scanline filler, the rule SVG applies by default.
Package rasttest is a test-only nonzero-winding scanline filler, the rule SVG applies by default.
refine
Package refine moves the control points of fitted curves to match the input's anti-aliasing: a bezigon is rasterised by exact area coverage and optimised against a soft coverage mask with the priors of Yang et al.
Package refine moves the control points of fitted curves to match the input's anti-aliasing: a bezigon is rasterised by exact area coverage and optimised against a soft coverage mask with the priors of Yang et al.
region
Package region cleans a per-pixel label map before tracing: specks and anti-aliasing slivers are merged into their neighbours and the palette is compacted.
Package region cleans a per-pixel label map before tracing: specks and anti-aliasing slivers are merged into their neighbours and the palette is compacted.
svg
Package svg writes traced paths as a compact, deterministic SVG document.
Package svg writes traced paths as a compact, deterministic SVG document.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL