Display image over SSH, no X

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.


Solution 1:

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

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

Solution 2:

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.