Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to display an image over SSH? There is not need for good quality, I just need an idea of what is in the images. Mostly these are icon files for websites and such. Sometimes I can just forward X over SSH and use display but sometimes I can't. I don't mind working in a non-X tty for applications such as fbi.

I have tried jp2a but most of the images are in .png format and it is cumbersome to convert each one to check what is in them. Also, by using only the ASCII characters the display is very very limited. Perhaps if it could use arbitrary UTF-8 characters this could be better.

I have tried fbi but it complains ioctl VT_GETSTATE: Invalid argument (not a linux console?) even when I'm SSHing in through a non-graphical tty. I did try the -T 2 option which doesn't throw any errors but I don't see the image. I suspect that the image is being 'displayed' on tty2 of the server, which I have no way to see (I could not get to it with chvt 2 even though I have root access).

I have tried links, w3c, and other console browsers but the best that I've gotten out of them is to see the image file displayed as if it were run through cat.

I have tried mplayer's console output options but those only support video, as they are in fact video codecs.

I have tried zgv however as a normal user it complains you must be the owner of the current console to run zgv and as root it just hangs, no output.

share|improve this question
up vote 7 down vote accepted

Try 'img2txt'. For Ubuntu it can be found in 'caca-utils' packet.

'caca-utils' seems to be also available as rpm.

share|improve this answer
I never heard of it before, but it seems perfect. +1 – Hennes Jan 25 '13 at 12:22
Thanks, this works for colour as well. – dotancohen Jan 25 '13 at 13:25
It works fantastically well. But I still can't make sense of the images, lol. – Camilo Martin Jul 11 '14 at 3:02
In your terminal program, lower the font size to something like 1x1 before viewing the image, then resize the terminal program to max size. – LawrenceC Jul 4 '15 at 23:01

Oneway to display an 'image' with a text screen is via aalib.

That will use ASCII chars to render an image, and if you have a large enough text area (sort of resolution) then you can recognise what is being shown.

You would run the conversion to ASCII-art/movies on the remote side of the SSH link.

Link: aalib demo on youtube.

Also, by using only the ASCII characters the display is very very limited.

Aye. Which means that unless you have a large terminal to play with you will barely recognisabnle images. If you can use a large terminal on a high density display (with sharp letters even when you use a tiny font) then it is useable.

share|improve this answer
Thanks. To use aalib, one must install (in Ubuntu) aalib1 and run it with asciiview file.jpg. That last command took me a while to figure out. – dotancohen Jan 25 '13 at 13:25
Revisiting this one year later, now to use asciiview one must install the aview package. – dotancohen Jan 16 '14 at 7:50

high quality (not as fast as ascii) concept:

 localComp$ ssh -R 33322: user@remoteComp
remoteComp$ cat image.jpg | ssh -p 33322 fim -i 
  • first, starting initial ssh connection always with reverse tunel for accessing localComp's ssh port 22 over random choose 33322.
  • using fim (fbi improved) instead of fbi, or any other tool that can read images from pipe (stdin). "fim -i" displays image from stdin.
  • same concept can be used to play video from remote computer with:

    remoteComp$ cat video.mp4 | ssh -p 33322 mplayer -vo fbdev2 -cache 16384 -

  • two lines can be saved to easy-to-run scripts, for example:

    #!/usr/bin/env bash
    ssh -R 33322: $1
    #!/usr/bin/env bash
    case "$2" in
    mplayer) cat $1 | ssh -p 33322 mplayer -vo fbdev2 -cache 16384 - ;;
          *) cat $1 | ssh -p 33322 fim -i ;;

  • SSH in direction remote->local should be configured as ssh without password, so that remoteview can be used as any program (transparent :openwith in ranger/mc/vifm for example). and top concept lines becomes:

     localComp$ sshfb user@remoteComp
    remoteComp$ remoteview image.jpg
    remoteComp$ remoteview video.mp4 mplayer
    remoteComp$ remoteview docum.pdf
    remoteComp$ remoteview audio.wav mplayer

share|improve this answer
What is fim and is there a link for fim? Please expand. – suspectus Jul 4 '15 at 8:12
@suspectus, actually it would be better if fbi can do this, because it seems simplier and faster tool... but i was looking for framebuffer image viewer that can display image from pipe (stdin) and fim comes up on [] ubuntu manpages, there is also [] (aur) for archlinux. but there is maybe somewhere better tool for this purpose – MetNP Jul 4 '15 at 22:01
interesting, thanks. – suspectus Jul 4 '15 at 22:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .