Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view images in Linux terminal

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to view the image in the Linux terminal, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Install ImageMagick

The ImageMagick package is included in the official repository of most Linux distributions. Use the distribution package manager to install it.

* * it is important to note that * * make sure that the "Development Tools" package has been installed on your Linux system, which is a prerequisite for installation.

For the RHEL/CentOS 6apace 7 system, use the yum command to install ImageMagick:

$sudo yum install-y ImageMagick ImageMagick-devel

On RHEL/CentOS 8 and Fedora systems, use the dnf command to install ImageMagick:

$sudo dnf install-y ImageMagick ImageMagick-devel

For Debian/Ubuntu systems, use the apt command or the apt-get command to install ImageMagick:

$sudo apt-get update$ sudo apt-get install imagemagick

For openSUSE systems, use the zypper command to install ImageMagick:

$sudo zypper install-y ImageMagick

To view any image files, run the display command, as shown below. You can press the Esc/q button to close the image:

$display bird.jpg

If you want to open the image with the specified window size, use the-geometry flag:

$display-geometry 1000x600 ~ / Downloads/bird.jpg

You can also enter the location information of the image through the display command. The following command opens the image from 800 pixels from the top of the desktop and 800 pixels from the upper left corner:

$display-geometry 1000x600+800+800 ~ / Downloads/bird.jpg

If you want to resize the image with the display command, use the following format:

$display-resize 600x400 ~ / Downloads/bird.jp

In addition, you can also use a percentage to resize the picture:

$display-resize 50% ~ / Downloads/bird.jpg how to use the fim command to view an image from a terminal

FIM is a lightweight global image viewer designed specifically for Linux. But it is not limited to Linux, it can also be configured to run on other operating systems, such as MS-Windows.

For users familiar with software such as VIM text editors, it is a highly customizable and scriptable image viewer. It can display images on full screen and can be easily controlled using keyboard shortcuts. It is a very lightweight tool because it relies only on certain libraries.

It can open many file formats and display images in the following video modes:

Use Linux frame buffering devices to graphically.

Under X/Xorg, use the SDL library to graphically

Under X/Xorg, use the Imlib2 library to graphically.

Use the AAlib library to render in ASCII art form in any text console.

The runtime automatically detects or selects the correct video mode, and if necessary, you can choose to add or remove it when configuring before building.

FIM is an acronym for "Fbi IMproved" and a replica of Fbi Image Viewer.

FIM can be easily installed on Debian/Ubuntu-based systems because the package is available in the official repository of the distribution. For other distributions, you may need to compile it from source:

$sudo apt install fim

After installation, you can use the following command to display the image:

$fim bird.jpg

You can use the-an option to automatically zoom the image:

$fim-a bird.jpg

If you want to open multiple image files in the current directory, use wildcards to open them all. Use the PageUp/PageDown keyboard shortcut to move to the next or previous image:

$fim-a * .jpg

To view the image in ASCII format, you can use the-t flag:

$fim-t bird.jpg

The following keyboard shortcuts allow you to control the image:

PageUp/PageDown: previous / next picture.

+ / -: zoom in / out

A: auto Zoom

W: fit width

ESC/q: exit

This is the answer to the question about how to view the image in the Linux terminal. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report