Options to show images when on the console

12,210

Solution 1

You can use the library from AA-Project

enter image description here

Applications:

  • xine-console [video]
  • xaos [fractals/mandelbrod]
  • vlc [video]
  • aview [photos]
  • ... a.m.o

Solution 2

Updated answer

Install ranger, a filemanager for the console. It shows colored images if the requiered programs are installed. Look into their rc.conf and search for preview.*image to learn how they do it and which programs they use and what requirements they have. Here is a list of programs they try to use (but better look into the rc.conf file:

  • w3m
  • iterm2
  • terminology
  • urxvt
  • urxvt-full
  • kitty
  • ueberzug

Old answer

Many images are coloured, hence you may use libcaca’s ASCII image viewer (cacaview) and image to text converter (img2iso).

  • To browse images, use the ASCII image browser:

      cacaview /usr/share/pixmaps/*.*
    
  • Convert images to text-based coloured files:

      img2txt -W 150 penguins_mating.png > penguins_mating.txt
    
  • View movies and videos in text console:

      mplayer -vo caca https://upload.wikimedia.org/wikipedia/commons/4/41/Big_Buck_Bunny_medium.ogv
    

    Mostly you don’t need the option -vo caca if you view your video in a text-only environment (terminal with ssh-connection, virtual terminal etc.). By default you’ll get the noncolored text-output (i.e. -vo aa), but color may be better.

For Fedora and Ubuntu the package caca-utils has to be installed.

Read here for more information.

enter image description here

Solution 3

First off you must make sure the framebuffer is enabled, there is absolutely no way to view images in text mode. Once you have the framebuffer enabled, you can use the program fbi to view images.

Package: fbi

Linux frame buffer image viewer

This is an image viewer for Linux frame buffer devices. It has built-in support for a number of common image file formats. For unknown files, it tries to use convert from the ImageMagick package as an external converter. It also includes fbgs, a Postscript and PDF viewer.

Solution 4

mplayer has a framebuffer driver (2 versions, in case one doesn't work). Use

mplayer -vo fbdev [or fbdev2] <filename>

For images, fbi and fim work. Whatever else these two can't handle, you can probably convert to images on the fly ( imagemagick works like magic), so you have everything covered.

Solution 5

You can use a framebuffer device. The framebuffer mechanism is the one used to display Tux when you boot.

There is also the libcaca used to display ASCII-art images.

Share:
12,210
Sumin Oh
Author by

Sumin Oh

Updated on September 18, 2022

Comments

  • Sumin Oh
    Sumin Oh almost 2 years

    When I am on the console (the tty, the virtual terminal, which you reach with Ctrl+Alt+F1-6, not a terminal emulator), what options do I have to view images, tiff, whatever that's not text?

    • Graeme
      Graeme over 10 years
      You mean the virtual terminal as opposed to a terminal emulator? unix.stackexchange.com/questions/4126/…
    • Sumin Oh
      Sumin Oh over 10 years
      @Graeme: yes, that's it.
    • user2914606
      user2914606 over 10 years
      see also: Gate One
  • lgeorget
    lgeorget over 10 years
    I kind of disagree. How would the Tux be displayed at boottime ? commons.wikimedia.org/wiki/File:KNOPPIX_booting.png ;-)
  • Livinglifeback
    Livinglifeback over 10 years
    Framebuffer. Without enabling frame-buffering it can't be done, should've mentioned that. But, They also mentioned being on a real terminal. Forgetting that they're not on a real terminal, on a real terminals (vt1000) or similar I'm fairly certain it's not possible.
  • terdon
    terdon over 10 years
    Could you add some more detail? How would one go about using these tools?
  • lgeorget
    lgeorget over 10 years
    It depends very much on your hardware and your needs. You should provide more details in your question and give context.
  • terdon
    terdon over 10 years
    Not my question. I am pointing out that when answering a question, you should include the details on how to do it. You are just giving two links to external sources, something we try to avoid. The idea is that answers on the SE sites are self-contained.
  • lgeorget
    lgeorget over 10 years
    Of course, but there is not just one way to use these tools. And there is not much context in the question so...
  • JdeBP
    JdeBP over 9 years
    Many real terminals have the ability to draw graphics. Graphics capability was a selling point in the 1980s. And getty isn't emulating anything.
  • quixotic
    quixotic over 6 years
    there's also the term emulator terminology that can be run on a framebuffer console (terminology --nowm). the included utility tycat can embed images.
  • user1404316
    user1404316 over 6 years
    Is that the one from the people of the 'enlightenment' desktop? I evaluated it maybe a year ago and it was buggy then, but if you can vouch for it, great!
  • quixotic
    quixotic over 6 years
    i just started looking at it and can't confirm lack of bugs, sorry. it's working mostly-ok on one system (intel gpu), doesn't work on another (nvidia proprietary driver, untested but likely works under nouveau). set XKB_DEFAULT_{LAYOUT,VARIANT,OPTIONS} env variables for xkb layouts (though AltGr doesn't seem to work right atm).
  • Flimm
    Flimm over 2 years
    cacaview in Ubuntu 21.10 opens a new window, it does not print the image out (in ASCII with colours) in the terminal.
  • erik
    erik over 2 years
    @Flimm Use ranger as described above. See my updated answer.