Project

Sprite Generator

Browser-local video to sprite sheet generator — step or batch-capture frames by range, tune a chroma key, arrange the strip, and export a transparent PNG sheet. No uploads, no server processing.

Shipped TypeScriptViteCanvas 2DHTML5 Video

Overview

A browser-based video to sprite sheet generator. Load a local clip into the native HTML5 player, step through it frame by frame, capture single frames or batch-extract a range, then arrange the strip and export a PNG sprite sheet. Decoding, frame capture and PNG export all happen in the tab: the selected file is read through an in-memory blob URL and is never uploaded, and the app makes no network requests once its own assets have loaded.

How It Works

Playback and metadata come from the browser's own video element. Previous Frame / Next Frame seek the player and report both the requested time and the presented frame time side by side. Capture Frames stores the current frame; batch extraction works on a 1-based frame range with either an evenly spaced count or a fixed frame interval, and every plan is previewed before it runs. Frame numbers are estimates — browsers expose neither container frame rate nor exact frame indices — so the app assumes 30 fps on load or measures a rate from presented frames during Detect Frames. Captured frames can be reordered, laid out in a grid with configurable columns, rows, cell size and gap, previewed as a loop, and exported as a transparent PNG or flattened against a matte colour.

Building It

A static Vite + TypeScript app with vanilla DOM controls and Canvas 2D rendering. Chroma keying is a small RGB-distance function with tolerance and softness, applied to the live preview and baked into captures; an eyedropper samples the raw, un-keyed video pixel. Memory guards cap stored frames, per-frame and total pixel counts, and sheet dimensions rather than letting the tab crash. Codec support is whatever the browser provides — nothing is transcoded. The only font is a self-hosted Geist Mono (SIL OFL); there is no CDN, analytics or remote font. Unit tests cover frame maths, capture planning, sheet geometry and chroma; Playwright browser tests drive the app with synthetic video fixtures.