Letter swarm guide
Overview
Script Swarm draws your picture with thousands of free-moving letters, a letter swarm in the picture's own colours, and lets your music move them.
Every letter is weighed first. It is drawn once and its ink is counted (glyph coverage, the same idea as ink weight), and its size is drawn from a size distribution, so its glyph mass is its ink times its size squared.
Then the picture says where the ink should go. Its tones become an ink demand; the letters are ranked by mass, and an inverse CDF of the picture's tones gives each rank the level it belongs at. A heavy letter in a dim place climbs the tone gradient, read near and far through a mip pyramid; a light one in a bright place slides down it.
Where a place still wants ink, its ink deficit spreads into a potential field that pulls letters in from far away. Letters that touch push apart with a separation force, so the crowd fills the picture without piling up, and each one wears the colour of the picture where it stands.
Thousands of letters are moved at once on the graphics card, in compute shaders through WebGPU. Sound is split into bass, mids and highs, each smoothed by an envelope follower, and spectral flux finds the beats: bass makes the letters pulse, mids swirl them, highs make them sparkle.
Save the frame as a PNG 3840 pixels on its long side, or a Take: a frame-exact render to MP4 with your song in it. It all runs in your browser; nothing is uploaded.
In this guide
- StartWhat you need and your first swarm in five steps.
- Every controlEvery control in the panel, one line each.
- Three looksThree pictures and the settings that made them.
- Keep your workThe PNG, the Take with your song, and Record live.
- KeysEvery shortcut, and what each one does.
- HelpWhat to do when something goes wrong.
It opens on two samples, Elder and Galaxy, written in kanji in the Lit look, the letters travelling from one to the other.
It needs WebGPU: Chrome or Edge on a computer, or Safari 26. Without it the frame shows a still and says so.
Letters chosen by their ink on a still grid are Ink Weight; letters that fill a word you type are Letter Field.