OK! I got the Spinners animated gifs working for mobile now
! (Also Ubuntu Image Viewer.)
After a bit of poking around with omggif which seemed like it was going to take way too long, so I gave gif.js
a look. I saw gif.js before, but I didn't read it that carefully and assumed it was only for the browser and wouldn't work for Node. I poked inside (always worth doing), and hey, although it does use web workers, a level down is a cleanly separated layer of modules that just do the work of 1) converting images to indexed images + a palette 2) encoding in LZW and 3) building the animated gif. Before I started uprooting animated gifs, I checked out the nice browser demo
and downloaded the animated gif it produced, mailed it to myself, then viewed it on my phone. Yup, shows up on phone!
omggif doesn't do indexing/palette building for you, so I cobbled together my own rough function for that, but gif.js does it for you with a tiny neural network (?!)
. It is slower, but it does look better. (Though there is something to be said for net art
-style colors.) As a result of it doing all that, the commit to webimage
So, Spinner gifs will be coming to the bot newsletter
for real! Probably!