'How can I display an image in the terminal?

Is there any sort of utility I can use to convert an image to ASCII and then print it in my terminal? I looked for one but couldn't seem to find any.



Solution 1:[1]

A program called cacaview allows you to do this.

It is interactive, allowing you to pan, zoom, and change display modes.

Cacaview example

(Full size image)

Solution 2:[2]

Try using the Google-Ninja before asking! I found cacaview and aview.

Solution 3:[3]

more simply, you may use img2txt from the caca library (cacaview is an image browser and opens a new window, which is not what is asked here I guess);

For instance :

Screenshot

on macosx, you may use homebrew :

$ brew reinstall libcaca --with-imlib2

(imlib is used to convert from different formats)

Solution 4:[4]

Here's a utility that does this (with source code):

http://www.codeproject.com/Articles/10949/ASCII-Art-Generator

Solution 5:[5]

A high quality fast standalone conversion utility (provided you have a 256 color terminal) is pxl, available at https://github.com/ichinaski/pxl.

Solution 6:[6]

Chafa

I like to use chafa.

chafa example.png

Screenshot

You can download Chafa from Chafa's website or from your favourite package manager, like APT:

sudo apt install chafa

Solution 7:[7]

Another alternative is to use the Ipython notebook: it is pretty good at doing what you ask for.

For bash: You have to prepend commands with a bang. For images: You may use the rich display system from ipython.

A screenshot of the result:

screenshot of the result

Complete answer in this post.

Solution 8:[8]

For Linux ubuntu

$gio open simpleImageFile.png

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Sarah Lasonia
Solution 3 Flimm
Solution 4 xxbbcc
Solution 5 Aleksandr Dubinsky
Solution 6 Flimm
Solution 7 meduz
Solution 8 Imranmadbar