RPIC

v0.11.0 — animation anywhere: clickable links, one-command animated pages & a standalone player

Describe the picture.
rpic draws it.

rpic is Brian Kernighan's pic picture-drawing language reimplemented in Rust — native SVG/PNG/PDF output, a 79-element circuit library, KaTeX-grade TeX math in labels, real typography (bold/italic/mono, any font & size), gradients, hatch fills,rgb()/hex colours (held in variables or computed), rotated labels, CSS hooks, a GSAP animation layer (enter/exit, motion, morph, typewriter, scramble, wiggle & drag), structured diagnostics and per-object geometry for visual editors. Classic pic stays classic; every extension is opt-in — and the engine is hardened to never crash or hang on malformed or untrusted source.

Get startedcargo install rpic-cli
.PS
texlabels = 1; margin = 0.12
  arrow "$u$" above
S: circle rad 10/72.27
  line right 0.35
G: box "$G(s)$" wid 1 ht 0.55 gradient "honeydew" "white" gradientangle 90
  arrow "$y$" above
  line -> down G.ht from last arrow then left last arrow.c.x-S.x then to S.s
  "$-\;$" below rjust
.PE

Kernighan-first

Classic pic semantics with dpic as the practical oracle — 72/72 manual figures at parity.

Batteries included

SVG, PNG and PDF from one pure-Rust binary. Python, JS/WASM, R and C bindings.

Honest extensions

Typography, colour, rotation, TeX math, gradients, hatch, animation, CSS hooks — each opt-in and inert when unused.

Built for editors

Per-object geometry, a fixed-canvas mode and structured diagnostics with exact spans — a stable base for visual tooling.

Watch it build

The same source, plus a few animate lines: rpic emits a GSAP timeline alongside the SVG. Scroll into view, or hit ▶ replay.

.PS
margin = 0.2
In: box "input" fit
arrow
P: box "process" fit
arrow
Out: circle "done" rad 0.32
animate In with "slide" from left for 0.5
animate 1st arrow with "draw" for 0.4
animate P with "pop" for 0.4
animate 2nd arrow with "draw" for 0.4
animate Out with "pop" for 0.5
animate P with "highlight" to "crimson" for 0.6 after Out delay 0.3 repeat -1 yoyo
.PE
input process done

Full palette on the animate reference.

Draw any segment

The wave below is a spline drawn by rpic. animate … with "draw"traces it — and from p/to preveal only a slice, highlighted over the full track as a fraction of the stroke. Hit Next value to sweep the window.

A nod to GreenSock's DrawSVGPlugin values demo, rebuilt on rpic's partial draw — stroke fractions, no plugin.

How to cite

Using rpic in academic work? Cite it via its Zenodo record. The concept DOI 10.5281/zenodo.21209915 always resolves to the latest release; each version also gets its own DOI, and GitHub's “Cite this repository” reads the CITATION.cff for BibTeX and APA.