This is a quick mockup I copy and pasted together. I imagine this being super cool and useful.
Does something like this exist already?
command lineimage-viewers
This is a quick mockup I copy and pasted together. I imagine this being super cool and useful.
Does something like this exist already?
Best Answer
Update 2021-03-02
Viu
Viu is an image viewer that can display images using either the kitty, iterm, or libsixel approach. It also has a fallback mode to display blocky ascii images.
Update 2018-12-31
kitty icat
The all around terrific terminal emulator kitty has an
icat
command to display images (does not work within tmux). Kitty also enables image previews within ranger (a terminal file manager), which is the method I currently use the most often (works within tmux).1. w3m
While the main purpose of
w3m
is to provide in-console web browsing, it can also be used to view images in terminal. The relevant packages to install arew3m
andw3m-img
(on Ubuntu at least). You then need to disable the external image viewer wither by passing-o ext_image_viewer=0
or by going into the options menu ('o') insidew3m
and disable external image viewing.Now, typing
w3m <image_name>
will display the image in terminal.w3m
will use the entire terminal window, so you cannot see your previous commands until quittingw3m
(thinkless
, notcat
). Note that if the image is to big to fit the terminal window, it will still be opened externally (in imagemagick for me). Also note that even though I read multiple places thatw3m
inline images would not work forgnome-terminal
, it is working fine for me. It is a little annoying that you have to typeq
twice to close first the image and thenw3m
.2. Terminology
tycat
is part ofterminology
and displays images likecat
displays text files and likeimgcat
works for iTerm2 on OS X.3. libsixel + mlterm/xterm
Install
libsixel-bin
and any compatible terminal (examples mentioned under 'Requirements' of this readme, for examplemlterm
orxterm
compiled with the right flags and you can view images with theimg2sixel
command. Both these packages are available in the Ubuntu repos.4. FIM
Then there is FIM which is an improved version of
fbi
. The homepage states that it can display images not only with the framebuffer, but also with X. However, it won't install for me. Edit I got it running by downloading the 0.5 trunk version, running./configure --disable-exif
and then temporarily removinganaconda
(python distribution) from my path since it caused a conflict withlibpng
before runningmake
andsudo checkinstall
(you need to write in a version number manually withcheckinstall
, but it makes it easier to remove thanmake install
). However, images are still displayed in a separate window, although like withfbi
you do not need to be running X which is kind of cool.5. jupyter-qtconsole
You could also get creative and use the jupyter-qtconsole as your system console, configure it to show plots inline (
%matplotlib inline
) and then display the image using matplotlib =)6. feh
feh
is using X to display images, butfeh -x
pops them up in a borderless window that can be quickly closed withq
orx
. Although images are not displayed in the terminal per say, I thought it was worth mentioning since it is the least intrusive way I have found so far and what I am using untilgnome-terminal
gets animgcat
/tycat
equivalent.