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