Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

This is a quick mockup I copy and pasted together. I imagine this being super cool and useful.

Does something like this exist already?

share|improve this question
I always just use feh! I know it's not in the terminal, but it does it's job. – dylnmc Oct 10 at 6:55

8 Answers 8

You cant do so in a terminal, but you can do so in a tty using fbi. You need a framebuffer to allow this to work

sudo apt-get install fbi

Go to a virtualterminal(TTY) and enter fbi <filname>

It should show your image

share|improve this answer
What do you mean by "terminal" vs "tty"? Aren't they the same thing?… – Wernight Jul 10 at 13:11
Didn't work for me. But "caca" tool worked. using "DejaVu Sans Mono-16", pixelsize=16.67 file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf ioctl VT_GETSTATE: Inappropriate ioctl for device (not a linux console?) – Felipe Micaroni Lalli Nov 9 at 22:06
@Wernight Ctrl + Alt + F1/F2/F3 gives you a tty under ubuntu (Ctrl + Alt + F8 to get back). – cheflo Nov 14 at 22:31
@FelipeMicaroniLalli I get the same error as you when using an X-based terminal instead of a tty. – cheflo Nov 14 at 22:32
There is also 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. – cheflo Nov 14 at 22:32

Maybe caca is what you want. For images:

sudo apt-get install caca-utils
cacaview /PATH/TO/image.jpg

Make sure your terminal window is big enough.

For example, here is how this image is displayed in cacaview:


I sometimes used it for fun to watch videos as ASCII in mplayer :) Like this:

mplayer -vo caca /PATH/TO/video.mpg
share|improve this answer
Very helpful - a command from caca-utils that should display images inline in the terminal is img2txt – Wilf Jul 18 '14 at 21:02

There's actually such a project named TermKit, if you'd like to test it - check out but it's quite unfinished (since you seem to have a Mac, you should try the Mac-version since it's "the original")

So yes, it's an idea worth exploring, however - the switch between graphical and text-only mode must be quick since I don't always need the images viewed. Also - it needs to be fully compatible with e.g. Vim..

share|improve this answer
I read about this project once before on Slashdot. Sounds intriguing! Too bad you need Google Chrome to use it...well, okay, it's not too bad if you use Chrome to begin with, but it seems like an unnecessary dependency. – Christopher Kyle Horton Jan 22 '12 at 10:58
@WarriorIng64 Yeah, I it could work if you hack a bit with Qt's WebKit - but fortunately we have the chromium-browser in the repos, so that it's quite easy to install something Chromelike - I haven't really tried TermKit on my computer (w/ Chromium installed, but using Fx as main) since I'm quite dependent on Vim, and can't really use a terminal that won't give me my beloved text editor ;) – sakjur Jan 22 '12 at 11:01

This does not exist; gnome-terminal is only capable of diplaying text, at least as far as I know.

However, you can call an image viewer from the commandline to see your pictures in a particular folder. So, going off of your mockup above showing you listing all .jpg pictures in the current folder, you can use Eye of GNOME (Ubuntu's default image viewer) from the commandline for something similar:

eog *.jpg &

Note that the window which comes up will only show one image at a time, though you can use the provided arrow buttons to cycle between them.

share|improve this answer
if running from a terminal, eog *.jpg & disown is better as otherwise the EOG will likely exit when the terminal closes. N.B. I wish EOG was still Ubuntu's defualt image viewer - shotwell is good, but tries to index my 30GB+ of pictures.... and is slow and annoying anyway – Wilf Jul 18 '14 at 21:13

Another alternative is terminology:

enter image description here

You can install it on ubuntu by adding Hannes Janetze e17 repository:

sudo add-apt-repository ppa:hannes-janetzek/enlightenment-svn
sudo apt-get update && sudo apt-get terminology
share|improve this answer
tycat to display an image inline and tyls -m to display medium sized thumbnails in a directory. – cheflo Nov 14 at 21:01

I wrote a tool to do this. I named mine Show Image In Terminal (shit). It assumes you have a 256 color terminal and UTF8 support, and it's written in perl.

I droped it in my ~/bin. It assumes you have Image::Magick, Term::Size, Getopt::Long and Time:HiRes, which should all be available in your distro's repositories, or CPAN.

My intent was to ssh into my house, and quickly view images without launching a display over X. Script scales to appropriate width/height for the terminal you are in. I used UTF8 characters to effectively double the vertical resolution of your terminal, which really helps clarity. YMMV.

Sample shots here

Source code here

share|improve this answer
It's "siit", not "shit" (seriously....) – Star OS Sep 24 at 7:40

Here are some solutions in node.js (Installation instructions here).

  1. picture-tube

  2. imaging

To install either, type npm install -g <package_name> where package_name is either of picture-tube or imaging.

share|improve this answer

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 are w3m and w3m-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') inside w3m 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 quitting w3m (think less, not cat). 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 that w3m inline images would not work for gnome-terminal, it is working fine for me. It is a little annoying that you have to type q twice to close first the image and then w3m.

2. Terminology

tycat is part of terminology and displays images like cat displays text files and like imgcat 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 example mlterm or xterm compiled with the right flags and you can view images with the img2sixel 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 removing anaconda (python distribution) from my path since it caused a conflict with libpng before running make and sudo checkinstall (you need to write in a version number manually with checkinstall, but it makes it easier to remove than make install). However, images are still displayed in a separate window, although like with fbi 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, but feh -x pops them up in a borderless window that can be quickly closed with q or x. 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 until gnome-terminal gets an imgcat/tycat equivalent.

share|improve this answer

protected by Braiam Feb 26 '14 at 23:17

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.