How to open an image file from the Linux terminal

Updated: 01/24/2018 by Computer Hope

Many image viewer applications are available for Linux. The simplest, most common and powerful is ImageMagick. To proceed, select a topic from the list below or view all of the sections in order.

Checking if ImageMagick is installed

ImageMagick comprises many different commands for viewing, manipulating, and modifying images. The tool used to display files is called display. To find out if it's already installed on your system, open a terminal and at the command prompt, run the following command.

display -version

If ImageMagick is installed, the command above displays the version information, like the example below.

Version: ImageMagick 6.8.9-9 Q16 i586 http://www.imagemagick.org
Copyright: Copyright (C) ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jpeg [...]

Installing ImageMagick

If you don't have ImageMagick installed on your system, you can install it with your package manager. To do so, use the command listed below that corresponds to your Linux distribution.

Debian or Ubuntu:

sudo apt-get update && sudo apt-get install imagemagick

CentOS:

sudo yum update && sudo yum install ImageMagick

Fedora:

sudo dnf update && sudo dnf install ImageMagick

OpenSUSE:

sudo zypper refresh && sudo zypper install ImageMagick

Arch Linux:

pacman -Sy imagemagick

Using ImageMagick to display a file

To display an image file, run display <file name>. For example:

display logo.jpg

The command above creates a new window displaying the image named logo.jpg, as shown in the example below.

Opening a picture using ImageMagick

Learn more about ImageMagick

To find out how to build and install ImageMagick from the source code, or find more about the many tools it provides, visit the ImageMagick website.