56 comments

[ 18.9 ms ] story [ 440 ms ] thread
Is it possible to do something like this, but writing the actual GIF to the host's framebuffer (/dev/fb*)? Or are we getting into X11 territory?
It's entirely possible to write a GIF to the framebuffer (setting aside that the framebuffer is deprecated in favor of KMS+DRM) without implicating X11.
Is it (or DRM) safe over an SSH connection?
You can't use DRM or the framebuffer over SSH, you can't open device files or do ioctls remotely like that.
I see. So I guess it's not really possible to do something like the OP with mixed text/graphics, sadly, you have to either stick to text or get an X11 terminal.
If you use a Mac, the Iterm2 terminal emulator has an additional protocol that supports rendering images [0]. It basically encodes the image with terminal escape sequences, and also works for animated gifs.

Unfortunately, it seems to not be a standard - it would be neat if there were such a standard, and if other terminals could/would do similarly. It seems like the silliest thing but I like being able to easily indicate when my tests fail or not:

    alias SUCCESS="echo -e '\n\nSUCCESS' \
        && imgcat ~/Pictures/success-100.png \
        || imgcat ~/Pictures/fail-100.png"

    make test && SUCCESS

0: https://www.iterm2.com/documentation-images.html
It's not standard, but there are other terms with their own custom escape codes such as Terminology (from Enlightenment DE) and Kitty (not to be confused with KiTTY, the fork of PuTTY).

There is also the sixel escape sequences will render using 6 pixel character blocks and is supported in xterm with the vt250 (iirc) support enabled.

For what it's worth, xterm also supports vector graphics if you enable the right kind of VT mode. But that's a whole other discussion :)

    $ mpv --vo=drm *.gif
My god.

I think programming as a profession has now jumped the shark.

Why do you think that? Is it because you personally find no value in this project? If you don't understand what the value of this project would be then it's not for you but that doesn't mean it has no value. Also, computer science and programming are built on the two mule team of 'because we need it' and 'because we can!' This is nothing new.
I'm mainly just joking, because it's combining two things that are trendy: GIFs in everything and CLI wizardry.

No real criticism of this software. If I had thought of it first I might have built it myself.

"CLI wizadry" is trendy?
Kind of, yes. More and more products and services are going to offer cli clients. Angular, vue, Azure, kubernetes, docker, choose your weapon.
That's been the norm since the 80's, not sure what's new about that.
The industry is, to a degree, cyclical and prone to fashions; CLI was everything in the 80s, then went out of style in many circles in the 90s and 00s, and now is coming back into style in more circles. And with each new wave we get new variations and fun things as new people hit the old ideas with new perspectives:)
+1 for

> "the two mule team of 'because we need it' and 'because we can!"

Is this phrase (two mule team) a common one? It's an apt turn of phrase.
I don't know, I grew up on a farm but I've never heard that before that I can think of. It was probably planed there at some point by old farmers talking but I can't be sure.
wrong, no worry no matter what
You can also do this easily with mplayer: mplayer -vo caca ~/my.gif
note that the heavy lifting there is done by libcaca...
Excellent choice for the example GIF. Haha.
Of course.

Love the little note at the end:

"This is not a supported Google product."

(comment deleted)
Actually it says:

    Disclaimer

    This is not an officially supported Google product.
Besides, what does it matter? It's a nice hack, but that's it. Noone will play Netflix over it... well, probably.
It's probably someone's 20% project.
I don't think you could get your manager to approve that as a 20% project.

More likely, it's someone's personal project they worked on in their spare time, but it still belongs to Google (because everything does, according to most engineering contracts there).

Wow that's a fairly serious clause!
> everything does, according to most engineering contracts there

Most of the contracts I've heard about only transfer ownership if you use company resources to work on it. Any project done in your free time, with your own resources, belongs to you.

Not at Google.
Sorry to be wearing my tin-foil hat here, but I wonder how much of this is actually an advertisement for Tenor?
Ah, this reminds me of fond memories of watching The Matrix converted to ASCII.
Can someone shine some light on how Tenor makes money?
¯\_(ツ)_/¯

well, they were acquired by google...

It should be "CLI for GIF" or "GIF CLI" or "GIF for terminal".

"GIF for CLI" doesn't make sense.

(comment deleted)
Stop calling text based graphics CLI! Grrr
Why are the results so dark?