News for hackers. Stuff that matters.
Re:Überzug: A CLI utility for drawing images on terminals by jitl on Saturday December 26, 2020 @04:40PM (#25546653)
A more practical and cohesive alternative is Sixel [https://saitoha.github.io/libsixel/], which is an in-band, escape based image format supported by “modern” terminal emulators, like iTerm2, which also has a proprietary image format [https://iterm2.com/documentation-images.html]

I prefer in-band images because it doesn’t require complex coordination between the process that wants to display the image and other software like X11, instead the process just writes out the appropriate bytes to the TTY and they get displayed.

Re:Überzug: A CLI utility for drawing images on terminals by hnlmorg on Saturday December 26, 2020 @07:13PM (#25547563)
I really want to like Sixel but it's such a horrible encoding, both in terms of specification and overall image quality. I much prefer the proprietary escape sequences that base 64 encode PNG (or similar) data. Granted the base 64 encoding will add ~30% to the image size in transit but modern image formats are compressed these days (which Sixel is not) so it's not a complete loss. Plus PNG will produce better quality images.

It's just a pity there isn't even a de facto standard for how to escape base 64 encoded image files. There's only 3 terminal emulators that I know of which support in-band images (Sixel aside): Kitty (not to be confused with KiTTY, a PuTTY fork), iTerm2 and Terminology. All of which have their own escape sequences.

I'd built a little script which opened an image in the terminal, irrespective of which terminal emulator you ran it would render the image in the best available format (falling back to ANSI block art if nothing better was available). It was a nightmare to write because of all the different terminals doing their own things. And when this stuff doesn't work there's no clue why because in-band escape sequences aren't something that produces an error if you get something wrong. It either works or it doesn't. Then you have multiplexers like tmux that can add their own undefined behaviour to proceedings.

As CLI tools go by, that was probably one of my most frustrating exercises for the least reward (I could probably count on one hand the number of times I've actually needed that script).

Re:Überzug: A CLI utility for drawing images on terminals by enriquto on Saturday December 26, 2020 @04:57PM (#25546754)
Sixel is really useful, but it is not optimal in terms of color quantization and fast rendering (it is quite a pain to write a color sixel image). The world needs a hero that submits simultaneously a patch to xterm, iterm and all widely used terminals to accept decent in-band color images--using verbatim framebuffers with a tiny header.
Re:Überzug: A CLI utility for drawing images on terminals by sprash on Saturday December 26, 2020 @06:33PM (#25547348)
Why stop at images? If you go the full way and include drawing commands like those in cairo script (https://cairographics.org/manual/cairo-Script-Surfaces.html) you can essentially abolish any other sort of app besides the terminal. Your GUI is then simply created by writing to stdout.
Re:Überzug: A CLI utility for drawing images on terminals by enriquto on Saturday December 26, 2020 @07:15PM (#25547576)
> ... simply created by writing to stdout.

Shut up and take my money!

No, really, that would be awesomely cool. Having support for in-band inline images is a useful start yet. I'm not the hero the world needs, but if I had a lot of money I would surely pay proficient hackers to write that thing.

Re:Überzug: A CLI utility for drawing images on terminals by remexre on Sunday December 27, 2020 @02:33AM (#25549515)
I think once you add the user input side, you've reinvented something not unlike X-as-it-originally was, though.
Re:Überzug: A CLI utility for drawing images on terminals by enriquto on Sunday December 27, 2020 @05:55AM (#25550224)
> you've reinvented something not unlike X-as-it-originally was

Sounds good to me. Technology advances by the continued reinvention of the wheel, that offers new opportunities for simplification and improvement at each iteration.

Re:Überzug: A CLI utility for drawing images on terminals by drran on Saturday December 26, 2020 @06:15PM (#25547236)
If you need verbatim frame buffers, VNC is good for that. Basically, you will need to integrate VNC protocol into terminal protocol.