6 ms·
Überzug: A CLI utility for drawing images on terminals
- ivanbakel 6y agoWhat I was surprised to learn when trying to set one of these up to use over SSH[0] - this image rendering is not "in the terminal" (in retrospect, it perhaps obviously can't be). These tools draw directly onto the X11 canvas, which for me begs the question - what are they for? If you want a real GUI that badly, why not use one that's not in the terminal? 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.
- unphased 6y agoI think once you've been "living" in your terminal for a while you're pretty used to the keyboard-centric life and going to a separate mouse-centric window manager world can be considered to be cumbersome. 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...
- falsaberN1 6y agoWhat this is doing is basically displaying an image, independently of your terminal, and keeping it in sync as you move the window, therefore won't work over SSH. 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.
- cpach 6y agoNo screenshots? (^_^)
- contingencies 6y agohttps://github.com/seebye/fmui#screenshots https://github.com/seebye/fmui#screenshots
- jitl 6y agoA more practical and cohesive alternative is Sixel [https://saitoha.github.io/libsixel/ 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 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.
- enriquto 6y agoSixel 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.
- drran 6y agoIf you need verbatim frame buffers, VNC is good for that. Basically, you will need to integrate VNC protocol into terminal protocol.
- deleted 6y ago[deleted]
- sprash 6y agoWhy 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 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.
- enriquto 6y ago> ... 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.
- amelius 6y agoBack in the old days, you could open a graphics screen on most home computers. E.g. in Applesoft BASIC, you could use HGR and PLOT commands to draw things. That simplicity is missing on modern computers.
- lars-b2018 6y agoThat's true. I remember the Atari 8-bit had the same thing, some modes having a text bottom and a graphical top where plot and such could be used.
- djeiasbsbo 6y agoYou could do that pretty easily with SciPy and PyPlot. Of course not as easily as a dedicated command, but it's pretty nice either way. I use it all the time to plot the waveform of audio files before I listen to them.
- Emptysister 6y agoevery now and then, I am using kitty terms "icat" kitten: https://sw.kovidgoyal.net/kitty/kittens/icat.html https://sw.kovidgoyal.net/kitty/kittens/icat.html
- anthk 6y agoFramebuffer and fim as the image viewer. Done.
- lrossi 6y ago> no race conditions as a new window is created to display images That is NOT drawing images on terminals. It’s just embedding an image viewer into the terminal window. This will not work over SSH.
- jart 6y agoIf anyone reading wants a tool for printing images and videos in an ssh terminal, then give https://justine.lol/printimage.html https://justine.lol/printimage.html and https://justine.lol/printvideo.html https://justine.lol/printvideo.html a try. I've seen a lot of projects that do this. I haven't seen any that do it better.
- Aeolun 6y ago> Draw images in terminals No image giving me a preview in the readme. I don’t know how people seem to always ignore the most important part somehow.
- bl333ding 6y agoWhat about Wayland support?
- yencabulator 6y agohterm just base64-encodes the file with some metadata and escape codes around it: https://chromium.googlesource.com/apps/libapps/+/master/hterm/etc/hterm-show-file.sh https://chromium.googlesource.com/apps/libapps/+/master/hter...