Überzug: A CLI utility for drawing images on terminals
github.com
github.com
No image giving me a preview in the readme. I don’t know how people seem to always ignore the most important part somehow.
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.
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.
Sounds good to me. Technology advances by the continued reinvention of the wheel, that offers new opportunities for simplification and improvement at each iteration.
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).
Ncurses-style CLIs have the benefit of being usable over bad connections and on headless boxes. I can't see why you would want to display an image in your terminal if you're already running a graphical session, and presumably have an image viewer installed.
[0]: turns out there are programs which turn images into blocks of coloured characters, and therefore do work over SSH.
That said, I do agree with you. I also think any image viewing functionality needs to have a practical way to get that image sent through the same channel as that terminal connection itself so that if you're on it remotely it will still work...
As what they are for, I use ueberzug and something like entr (tool that watches a file for changes) to display the output of programs that generate images, without having to either open the image manually or open a new image viewer through scripting. Another use I had for it was to visualize a syntax tree of an expression when I was writing a compiler, to ensure everything made sense in a more visual way. I don't know if it has any use for sysadmin tasks, to be honest, but for my hobby programming projects it's rather useful.
As you note at the end there are tools to do the blocks thing, like Sixel (it's mentioned elsewhere in this news' comments) but you will need to watch out for size and colors. Representing a large, complex image over sixels is a bit meh, but for smaller ones like say 160x144 it should work.
I use it all the time to plot the waveform of audio files before I listen to them.
That is NOT drawing images on terminals. It’s just embedding an image viewer into the terminal window.
This will not work over SSH.