In the next article we are going to take a look at FIM. As a regular user of the terminal, I did not know of any application that would allow me to view images from it. This didn't seem normal to me, especially when compared to the number of GUI image viewers available today for the Gnu / Linux world. Navigating a bit, I have come across a CLI image viewer called FIM. With this viewer I can finally see my images from the terminal. This utility is characterized by its low weight. It is very light comparing it to most GUI applications for viewing images.
END means Fbi IMproved. For those who don't know, Fbi is an image viewer frame buffer for Gnu / linux. This tool will use the system framebuffer to display images directly from the command line.
General characteristics of FIM
By default, it shows images bmp, gif, jpeg, PhotoCD, png, ppm, tiff and xwd from the terminal. For other formats, it will try to use ImageMagick's conversion.
As I already wrote lines above, FIM is based on Fbi and is a highly customizable and programmable image viewer aimed at users who are comfortable with software such as the Vim text editor or the Mutt mail client.
It will show us the images in full screen and it will allow us to control the images (how to resize, flip, enlarge) using the keyboard shortcuts.
Unlike fbi, the utility FIM is universal. It can open many file formats and can display images in the following modes:
- Graphically, with the Linux framebuffer device.
- Graphically, in X / Xorg, using the SDL library and Imlib2.
- Represented as ASCII Art in any text console, using the AAlib library.
FIM is completely free and open source.
Install FIM
This image viewer is available in the default repositories of DEB-based systems like Ubuntu, Linux Mint. For this example I'm going to use Ubuntu 18.04, so to install the tool, I'm just going to open a terminal (Ctrl + Alt + T) and type:
sudo apt-get install fim
Using FIM
Once installed, we can view an image with the 'automatic zoom' option using command:
fim -a ubunlog.jpg
Here is the sample output from my Ubuntu.
As you can see in the screenshot above, FIM did not use any external GUI image viewer. Instead, use our system's framebuffer to display the image.
If we have several .jpg files in the current directory, we will be able to use wildcards to open them. We will only have to use the tool as shown below:
fim -a *.jpg
For open all images in a directory, for example from the Images directory, we would execute:
fim Imagenes/
We can also open images recursively. First those of the folder and we continue with those of the subfolders. Then the list will be sorted. To execute this opening, we will launch the command as follows:
fim -R Imagenes/ --sort
If what we want is render an image in ASCII format, we will only have to add the -t option.
fim -t ubunlog.jpg
For salir, just press ESC or q.
Keyboard shortcuts
In order to better see our images, we will have at our disposal several keyboard shortcuts. In the following list, you can see the most common shortcuts to control images in FIM:
- Page Down / Page Down → Prev / Next image.
- +/- → Zoom In / Zoom Out.
- to → Autoscale.
- w → Fit to width.
- h → Fit to height.
- j / k → Unfold / raise.
- f / m → Flip / mirror.
- r / R → Rotate (clockwise and counterclockwise).
Uninstall FIM
To remove this tool from our computer, we will only have to open a terminal (Ctrl + Alt + T) and in it write:
sudo apt purge fim && sudo apt autoremove
More in-depth details on this tool can be obtained by consulting the man pages:
man fim
For more information about this application and the framebuffer, you can consult the page nongnu y savannah.nongnu. More detailed information can be obtained from them.