💾 Archived View for jfh.me › posts › 2019-02-23-ascii-face.gmi captured on 2022-04-29 at 11:23:59. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

Video to ASCII Art

For whatever reason, I'm fascinated with ASCII Art. I guess it's because it reminds me of old school computing and hacking.

I was curious today if I could create animated ASCII Art from a video. It turned out to be pretty easy.

jp2a

find . -type f | sort | xargs -I xxx jp2a --width=200 xxx --output=xxx.txt
(function() {
    var pres = document.querySelectorAll("#images pre");
    var len = pres.length;
    for(var i = 0; i < pres.length; i = i + 1) {
        pres[i].style.display = 'none';
    }
    var a = 0;
    window.setInterval(function() {
        pres[a].style.display = 'none';
        pres[(a + 1)%len].style.display = 'block';
        a = (a + 1) % len;
    }, 40);
}());

Link to Gist

The basic approach was to hide all but one of the ~pre~ tags. Then there is a timer that's running regularly to change which ~pre~ tag is showing.

You can see the final html document

./ascii-face.html

The Final Gif