Hacker News new | past | comments | ask | show | jobs | submit login
GIF for CLI (github.com/google)
119 points by lainon on June 14, 2018 | hide | past | favorite | 52 comments




Or if we go even deeper down the rabbit hole:

https://en.wikipedia.org/wiki/Sixel


Or the even more venerable (i think) aalib:

http://aa-project.sourceforge.net/


"libcaca"... interesting name

looks like they are keeping with theme: https://github.com/cacalabs/toilet


My version written in go: https://github.com/moshen/gotermimg


I made something similar in Go. https://github.com/esimov/gifter


Of course.

Love the little note at the end:

"This is not a supported Google product."


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).


> 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.


Wow that's a fairly serious clause!


Any source for this?




> This is part of the process for releasing Google-owned code as open source.

20% projects are Google-owned code.


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

"GIF for CLI" doesn't make sense.


If you like this project then you might like these ones.

Image visualisation in terminal using Unicode 9 and True Color:

https://github.com/daleroberts/tv

Image visualisation for iTerm2:

https://github.com/daleroberts/bv

Matplotlib graphics and animation in iTerm2:

https://github.com/daleroberts/itermplot


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?


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


See https://sw.kovidgoyal.net/kitty/graphics-protocol.html for a much more comprehensive terminal graphics protocol


Slick :D Thanks for pointing that out!


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 :)


Or we could try using sixel...

https://en.wikipedia.org/wiki/Sixel


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.


    $ mpv --vo=drm *.gif


Libsixel is also pretty sweet. You can even integrate it with sdl and all kinds of crazy shit.

https://github.com/saitoha/libsixel/


Ah, this reminds me of fond memories of watching The Matrix converted to ASCII.


You can also do this easily with mplayer: mplayer -vo caca ~/my.gif


note that the heavy lifting there is done by libcaca...


Can someone shine some light on how Tenor makes money?


¯\_(ツ)_/¯

well, they were acquired by google...


Stop calling text based graphics CLI! Grrr


Excellent choice for the example GIF. Haha.


Why are the results so dark?


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.


I literally have no idea what that comment is supposed to mean?!



which was reprised in an episode of arrested development where Henry Winkler (who played Fonzie in Happy Days) jumps over a shark on a dock: https://i.imgur.com/uHPHW0c.gif




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: