Wezen

Same frames. Same bytes.

Wezen turns Ruby pixel data into deterministic APNG, GIF, PNG, and asciinema media. No runtime dependencies beyond the standard library.

demo / 160×906 frames / 640 ms
Changed pixels onlyx 64 / y 29 / w 40 / h 42
APNGLossless rectanglesdemo.apng
GIF89aGlobal median-cut palettedemo.gif
Cast v2Chronological JSON Linesdemo.cast

Encode for the place it plays.

One animation timeline produces stable assets for browsers, terminals, documentation, and test fixtures.

APNG

Preserves full RGBA pixels and writes changed frame rectangles when it can do so exactly.

GIF89a

Builds deterministic global or adaptive palettes with optional Floyd–Steinberg or Bayer dithering.

PNG

Writes compact, predictable still images with Ruby’s standard zlib implementation.

Cast v2

Serializes terminal output, input, and resize events in asciinema JSON Lines format.

Shape the timeline before export.

Pixel operations stay explicit. Repeated frames coalesce, delays remain visible, and every encoder receives the same source.

gem install wezen
coalesce

Merge repeated frames

Combine identical or near-identical pixels and add their delays.

scale

Resize without ambiguity

Apply deterministic nearest-neighbor scaling to every RGBA frame.

crop

Keep the useful region

Crop the same explicit bounds across the complete animation.

drop_to

Set the sample rate

Reduce a timeline to a chosen frames-per-second target.