Raspberry Pi

Display Images on Raspberry Pi Terminal: Install Fim

Fim is a Linux-based lightweight image viewer utility that allows users to view images from the terminal. It is extremely useful for those users using Raspberry Pi OS lite version since installing this utility will help them view image directly from the terminal. For the GUI users, this can be useful in editing the image according to their choice since different commands can be used for editing purposes.

In this article, you will see how to display images on Raspberry Pi through terminal with Fim utility.

Display Images on Raspberry Pi Terminal Using Fim

Before proceeding, first we need to install the Fim tool on Raspberry Pi from the following command:

$ sudo apt install fim -y

Once the installation is done, you can perform different operations with Fim, which are discussed below:

1: Auto Zoom Image Using Fim Tool

The terminal based Fim tool is easy to perform image related tasks. Where autozoom of an image is possible by below command. Here “-a” function perform autozoom when it come with Fim tool.

Below picture is being used to Reference which is at default zoom.

$ fim -a <example>.jpg

The above image is the defected image by Fim tool, whose zoom percentage gets 62%. Additionally, users can also zoom in/out an image by hitting “+,-” button from the keyboard.

2: Display All Images in the Directory

In order to display all images in a directory one by one, you can use the following command:

$ fim -a <Directory> *.<Format-of-Picture>

The above picture shows all images in the current directory. There is total 6 images, which can be viewed by using mouse CLICK or page up / page down keys.

3: Rendering of Picture using ASCII

ASCII is commonly used to encode data into text. In case of Fim ASCII, the output result of the picture will be converted into encoded characters. To see how rendered picture will look, you need to execute the below-given command.

$ fim -a -t <Directory>/<Picture-name>.<Picture-format>

The above command converts the picture into ASCII format.

Additional Commands for Fim

Here is the list of few commands that can be used with the Fim tool to perform multiple operations.

Parameter Command
Fit Width w
Fit Hight H
Zoom in/out +/-
Pan down/up j/k
Flip f
Mirror m
Rotate Clockwise R
Rotate Counterclockwise r

If you are looking to remove the Fim tool from Raspberry Pi. Then execute the following command.

$ sudo apt remove fim -y

Conclusion

Few Raspberry Pi users preferred to run lite version of Raspberry Pi OS or they only want to use the terminal for performing tasks. In that case, installing a Fim tool on Raspberry Pi system will help them view the images directly from the terminal. The above guideline is crucial in installing the Fim utility on Raspberry Pi and displaying image on the terminal through different commands.

About the author

Muhammad Nasir

Hi! I am an engineer and technical blogger by profession and I enjoy getting things done with electronics. I am using this platform to share my knowledge in the field of Raspberry Pi, Linux, and Embedded Systems with others.