Motion, written.

nippo is a video library for hd. A video is a program, every frame is a pure function of time, and the GPU draws it.

“construct”, nippo’s 100-second showcase. Every frame, the 3D bottle and the score are hd code. Read its source.

A video is a program

A view is an ordinary function that draws. It reads the time of the frame it is asked for, so nothing carries over between frames: any frame renders on its own, in any order, with the same result.

Animation is arithmetic on time: progress windows, springs, keyframe tracks and staggers. Layout, text and effects are library calls, and the type checker reads all of it before a pixel is drawn.

fn heading() -> Child $ Drawing:
    text("Motion, written.", size=120.0, weight=800.0, font=FONT)
        .reveal_words(ms(200), ms(160), ms(420))
        .style_words(.Last, color=.Some(hex(LIME)))
        .look(glow(24.0, strength=0.6 * progress(ms(800), ms(1600))))

fn rule() -> Child $ Drawing:
    width := 640.0 * Spring {}.at(now() - ms(700))
    rect(0.0, 0.0, width, 6.0, hex(LIME), radius=3.0)

fn card() -> Child $ Drawing:
    shown := column(gap=36.0, align=.Center):
        heading()
        rule()
        text("Videos as code, drawn on the GPU", size=44.0, font=FONT)
            .opacity(progress(ms(1200), ms(1900), ease=.EaseOut))
    shown.center_in(1920.0, 1080.0)

Fast by design

One process: hd builds each frame, Vello and WebGPU draw it, ffmpeg encodes. The 100-second showcase, 3,000 frames at 1080p, renders in about 12 seconds on an M3 Max.

Looks are code

Glow, blur, glass, light rays, film grain and transitions are hd functions over one primitive: a WGSL shader over other nodes. Write your own the same way.

Clips keep their own time

Each clip starts at zero. Put clips in series with overlaps and transitions, layer them, or retime them: speed, reverse, freeze, loop, echo, motion blur.

Checked before it renders

A video declares what must hold: no missing glyphs, text inside the safe area, chart labels apart. check reports each failure with the time and the fix.

Your own files

Fonts, images, footage, music, sound effects and SVG are read once, before the first frame. Views draw what was prepared, so frames stay pure.

Batteries included

Kinetic type and text morphs, particles, charts and counters, code with token morphs, Typst math, captions, 3D lathes and extrusions, and a synthesizer for scores written in code.

A tour through the film

Each scene of “construct” shows one part of nippo.

Get started

You need hd 0.0.10 or later, ffmpeg and a GPU (Metal, Vulkan or DX12). Releases carry the renderer prebuilt for macOS and Linux, on arm64 and x86_64, and hd downloads the one for your machine.

# hd itself
curl -fsSL https://raw.githubusercontent.com/HerringtonDarkholme/hd-lang/main/install.sh | sh

# a new project, and nippo's renderer for this machine
hd new -t HerringtonDarkholme/nippo-starter my-video
cd my-video
hd fetch
hd run --release -- still hello --at 2000 --out frame.png   # one frame, to look at
hd run --release -- render hello --out hello.mp4            # the whole video

The starter is a five-second video in its own font, with tests. Getting started walks through it, and the examples cover the rest of the API.

Made for AI agents, too

nippo ships an agent skill. It teaches an agent the model, the loop of checking a few frames before rendering, the API by job, and the mistakes the compiler can’t catch. Its three example projects are checked against nippo.

Read the skill

npx skills add HerringtonDarkholme/hd-skill
npx skills add HerringtonDarkholme/nippo