Ascii Animations of GIFs

Motivation

Pre-research

Problem

Solution 1: Write directly to a pre tag with js

const N = frames.length;
const total = W * H * N;
const atlas = new Uint8Array(total); // 1 byte per pixel per frame

frames.forEach(({ patch }, f) => {

const frameOffset = f * W * H;

for (let i = 0, p = 0; i < patch.length; i += 4, p++) {

const R = patch[i],

G = patch[i + 1],

B = patch[i + 2]; // we essentially end up with a bunch of frames that are empty

atlas[frameOffset + p] = rgbToLuma(R, G, B) | 0; // fast floor to int

}

});