An 88×31 pixel GIF button loops the first chapter of *Moby‑Dick* using TomThumb font and ImageMagick.
*A step‑by‑step guide shows how a plain‑text copy of Melville’s novel can be compressed into a looping 88×31 pixel GIF. The method exploits ImageMagick’s text rendering and GIF framing to cram an entire chapter into a web‑compatible button.*
A niche corner of the web still hosts 88×31 pixel buttons—tiny graphics that flash text, logos, or counters. Yesterday, a Hacker News post detailed how to cram Herman Melville’s *Moby‑Dick* into such a button using only free, POSIX‑compatible tools. The author started with a plain‑text version of the novel, stripped licensing boilerplate, and reshaped the prose into 22‑character lines that fit the button’s width. By feeding those lines into ImageMagick, each line becomes a frame in a looping GIF, producing a 19‑hour, 4.2 MB animation that scrolls the entire book across a single web element. The guide shows that even the most constrained visual format can host a full literary work, challenging assumptions about digital minimalism.
The 88×31 pixel button is a legacy web graphic, originally designed for banner ads and site counters. Its tiny footprint—0.003 megapixel—forces creators to prioritize legibility. Arial only becomes readable at a minimum of 10‑pixel height, limiting visible text to roughly eleven words. By contrast, ultra‑small fonts such as TomThumb (6×4 pixels, effectively 5×3 with spacing) can fit five rows of 22 characters each, allowing a full line of prose in each frame. The format’s size constraints have kept it niche, but its ability to animate without heavy bandwidth makes it attractive for low‑resource sites.
The workflow begins with a plain‑text copy of the book, stripped of licensing headers and pre‑chapter material. A POSIX pipeline—cat, tr, fold—converts line breaks to spaces, removes carriage returns, and wraps the stream at 22 characters without splitting words. Non‑ASCII characters are purged with sed, ensuring the 6‑pixel pointsize font renders cleanly. ImageMagick’s convert reads the formatted lines from standard input, places each line on an 88×39 canvas, and outputs a multi‑frame GIF. A second convert call crops the extra eight‑pixel margin, sets a 600‑centisecond (6‑second) frame delay, and coalesces frames into the final 88×31 button. The result is a looping visual of the text, frame by frame.
Standard fonts collapse at the 88×31 scale; Arial needs at least ten pixels to stay legible. The community has responded with bitmap fonts engineered for extreme compression. Some designs shrink to 3×3 pixels, but TomThumb, available as a TrueType file, strikes a balance. At a 6‑pixel pointsize, TomThumb renders crisp characters within a 5×3 grid plus spacing, fitting the button’s dimensions without sacrificing readability. The author of the guide recommends TomThumb as the “golden middle” for low‑resolution GIF buttons, noting its ease of inclusion (simply place tom.ttf in the working directory).
GIF specifications impose no hard limit on frame count, and the maximum resolution is 2^16 by 2^16 pixels (4295 megapixels). The 88×31 button stays far below that ceiling, allowing virtually unlimited frames. The author’s full‑book example spans 19 hours of animation and occupies 4.2 MB of bandwidth—tiny by modern standards but sizable for a single button. The 6‑second delay per frame balances readability with file size. Users can trim the animation to a single chapter for faster loading, as demonstrated by the attached short‑form GIFs.
Using a 6×4 pixel font (5×3 plus spacing), the button can display five rows of 22 characters each.
The guide sets a delay of 600 centiseconds, which equals six seconds per frame.
The complete 19‑hour animation of *Moby‑Dick* occupies 4.2 MB.
The experiment proves that legacy web formats can still surprise when paired with clever scripting. By leveraging tiny bitmap fonts and ImageMagick’s text‑to‑GIF pipeline, creators can embed entire texts into a space smaller than a thumbnail. As bandwidth remains a premium on mobile and IoT devices, such ultra‑compact media may see a resurgence. The next wave of digital expression could very well be measured in pixels, not megabytes.
Sources: [Hacker News – Making a 88x31 button book using ImageMagick (https://k.sosnierz.me/08-11-24/)]