In the next article we are going to take a look at some Image viewers for use in the terminal. Today users can find many GUI applications to view images in Gnu / Linux. This is fine, but when you spend most of your time in the terminal and working with a lot of images, it can become difficult to identify them all.
As is usual in the Gnu / Linux world, some people got down to work to be able to offer some alternatives that allow us to see images in the terminal. In the following lines we are going to take a look at 3 CLI image viewers. Nobody expects high definition or anything like that. These applications can be useful for users who are looking to use CLI alternatives to GUI applications and who live most of the time in the terminal.
Image viewers for the terminal
Image display in Terminal using FIM
FIM stands for Fbi IMproved and use the system framebuffer to display images directly from the command line. By default, it shows bmp, gif, jpeg, PhotoCD, png, ppm, tiff and xwd. For other formats, it will try to use ImageMagick's converter. This utility is highly customizable, programmable, and lightweight when compared to most GUI image viewers.
Displays images in full screen and can be controlled using keyboard shortcuts. FIM is completely free and open source. They can be consulted more features in an article previously published on this blog.
Install FIM
The image viewer FIM is available in the default repositories of DEB-based systems like Ubuntu, Linux Mint. We will be able to install it by opening a terminal (Ctrl + Alt + T) and using the command:
sudo apt install fim
If you prefer download, compile and install from source you can follow the instructions outlined in the section titled 'Download and build instructions'which can be read on the official documentation.
Using FIM
Once installed, you can display an image with the 'automatic zoom' option using the command:
fim -a ubunlog.jpg
For more details, you can refer to the manual pages.
man fim
Viewing images in Terminal using Viu
Viu is another command line application for viewing images from the terminal. Is a free, open source CLI image viewer written with the Rust programming language.
Using Viu we can see the most popular types of images, including .jpg, .png, gif, etc. It also allows you to view images in custom dimensions and view images directly from image hosting platforms, such as tinypic.
Install Viu
Since Viu is written with Rust, we can install it using Cargo package manager. After install Rust On Ubuntu, run the following command to install Viu:
cargo install viu
Viu is also available as compiled binary. You just have to download the latest version from the releases page. As of this writing, the latest version is 0.2.1.
After downloading the Viu binary file, make it executable typing in terminal (Ctrl + Alt + T):
chmod +x viu
Y move it to the path / usr / local / bin.
Using Viu
Using Viu is straightforward. You just have to write viu followed by the image path and press Enter.
viu ubunlog.jpeg
This utility can display an image with a custom dimension using the -h options (Height) or -w (Ancho Steak:) as it's shown in the following:
viu imagen.jpeg -w 40
For view multiple images, one after another, saved within a folder, you have to use wildcard characters as shown below:
viu Imágenes/*
As I already mentioned, Viu is capable of displaying images of different formats. For example, the following command would show a gif image using Viu:
viu imagen.gif
We will also be able to view images from image hosting sites, such as tinypic. To see an image in the terminal, you will have to type something like the following:
curl -s http://oi44.tinypic.com/2nw0c5c.jpg | viu -w 40
For get more details about Viu, you can consult the help section by typing the command:
viu --help
Viewing images in Terminal using Lsix
Unlike the previous two image viewers, Lsix will only show thumbnails in the terminal. This utility would be something like the command 'ls'on Unix-like systems, but only for images. For know more about Lsix you can consult Article that we wrote on this blog a while ago.