Making a 88x31 button book using ImageMagick

33 points by nathell 11 hours ago on lobsters | 7 comments

FRIGN | 6 hours ago

sloane | 4 hours ago

i keep a gif of the entirety of the bee movie handy for special occasions

FRIGN | 4 hours ago

Godspeed

Is there a backstory to why this exists?

chrismorgan | 7 hours ago

The Moby Dick text is approximately 1,200,000 characters long, so at 4,198,301 bytes, the GIF is spending about 3.5 bytes per character, 334 bytes per frame (there are 12565 frames). Doesn’t feel too bad, but surely we can do better?

convert full.gif full.apng produces a 29,286,609 byte file—call it 24 bytes per character. Definitely not better. Apparently none of the tools I normally use like animated PNGs: optipng demurs: “Can't reliably reduce APNG file; disabling reductions. (Did you want to -snip and optimize the first frame?)”, while advpng and zopflipng just blat the animation without remark, cheerfully shrinking it to 1323 or 1221 bytes.

Neither gzip nor zstd manage to shrink the GIF or PNG by more than 8%, but can shrink the raw text to 40% and 33%.

I’m not sure if you get cross-frame compression in PNG, or how to do better there. The single-frame shrunk sizes were not impressive.

I’m not conversant with the best tools for WebP or AVIF animations. convert gives a 19,225,738-byte .webp file and eventually gives a 3,219,347-byte .avif, not sure if that’s lossless or not, didn’t look closely. Bit smaller at last, but still not all that much better.

There, I’ve spent all the time I’m going to spend on it now. Not sure at this point whether I am nerd-sniped or nerd-sniper… or both.

Internet_Janitor | 7 hours ago

ImageMagick doesn't generally produce minimal file sizes. I tried running the original GIF through gifsicle -O3 and losslessly crunched it down to 4,066,468 bytes, saving 131,833 bytes without changing format.

gnafuthegreat | an hour ago

From the title, I was initially expecting some e-book containing a collection of classic 88x31 buttons with the e-book being generated with ImageMagick. What this actually ended up being is even more fun.