How to Install ImageMagick on Rocky Linux EL9 or EL8

ImageMagick, a renowned open-source software suite, offers a comprehensive solution for image processing tasks. This guide provides a detailed walkthrough for those aiming to install ImageMagick on Rocky Linux 9 or the older stable Enterprise Linux release of Rocky Linux 8. ImageMagick’s versatility and expansive feature set make it an indispensable tool for professionals across various domains, from web design to digital artistry.

Noteworthy Features of ImageMagick:

  • Diverse Format Support: ImageMagick boasts compatibility with over 200 image file formats, ensuring seamless reading, conversion, and writing capabilities across popular and niche formats.
  • Comprehensive Operations: Beyond mere format conversions, ImageMagick facilitates many image operations, from basic tasks like resizing and cropping to intricate manipulations involving color adjustments and special effects.
  • CLI and API Integration: ImageMagick’s command-line interface is ideal for automated tasks and batch processing. Moreover, its APIs, compatible with languages like C, C++, Perl, and Python, enable smooth integration into larger software projects.
  • Universal Compatibility: ImageMagick’s cross-platform design ensures its robust features are accessible, whether you’re on Linux, Windows, or macOS.

Further enhancing its appeal, ImageMagick benefits from a vibrant community that consistently contributes to its development. This ensures the software remains updated, catering to the evolving needs of the image processing realm.

As we transition into the practical aspects, this guide will demonstrate the steps to install ImageMagick on Rocky Linux 9 and its predecessor, Rocky Linux 8. The subsequent sections will provide a step-by-step installation approach tailored to these Linux distributions.

Install ImageMagick on Rocky Linux 9 or 8 via DNF

Step 1: Update Rocky Linux System Packages Before ImageMagick Installation

Let’s begin the installation procedure by updating your system packages. An up-to-date system ensures that you have the latest bug fixes, security patches, and software updates. This enhances the overall performance and security of your Rocky Linux system.

Run the following command in your terminal to update your system packages:

sudo dnf upgrade --refresh

This command may require some time to complete based on the status of your installed packages. You must upgrade all packages successfully before moving to the next step.

Step 2: Import EPEL 9 or EPEL 8 for Rocky Linux

In order to install ImageMagick, we first need to import the EPEL (Extra Packages for Enterprise Linux) repository. EPEL is a Fedora Special Interest Group that creates, maintains, and manages a high-quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS, and Rocky Linux.

Importing EPEL for Rocky Linux 9

First, we need to enable the CodeReady Builder (CRB) repository. CRB is a channel that provides additional packages for developers, including debug packages and the development packages.

Execute the following command in your terminal to enable the CRB:

sudo dnf config-manager --set-enabled crb

Next, we proceed to install EPEL repository on your system. The installation is done via the terminal with the help of the dnf command.

Use the following command to import EPEL for Rocky Linux 9:

sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

After running the command above, the system will fetch and install the specified EPEL repositories.

Importing EPEL for Rocky Linux 8

For users operating on Rocky Linux 8, you would need to follow a similar process as Rocky Linux 9. The only difference lies in the repository URLs.

Here’s the command you need to run for importing EPEL on Rocky Linux 8:

sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-8.noarch.rpm

By running this command, your system will fetch and install the EPEL repositories pertinent to Rocky Linux 8.

Step 3: Install ImageMagick Using DNF

After successfully importing the EPEL repository, we can install ImageMagick on your system.

Now, execute the following command to install ImageMagick:

sudo dnf install ImageMagick

This command instructs the DNF package manager to fetch the latest version of ImageMagick from the enabled repositories, along with any dependencies required.

Step 4: Verifying the Installation of ImageMagick

After completing the installation process, you should check if you have successfully installed ImageMagick and if it’s ready for use.

To check the installed version of ImageMagick on your system, you can use the convert --version command as shown below:

convert --version

The command displays the ImageMagick version installed on your system, verifying the successful software installation using EPEL.

Install ImageMagick on Rocky Linux 9 or 8 via Source

In certain scenarios, you may find it necessary to install ImageMagick directly from the source. This approach offers the flexibility to select a specific version or tailor the build options to your needs. This process involves a series of steps which we’ll walk through in detail.

Step 1: Install Initial Build Dependencies For ImageMagick on Rocky Linux

For the successful compilation of ImageMagick from the source code, certain dependencies are necessary. These include gcc, clang, and make, which are instrumental in the build process. You can install these using the following command in your terminal:

sudo dnf install gcc clang make

Step 2: Download ImageMagick Source Code on Rocky Linux

Next, you’ll need to obtain the ImageMagick source code. The official GitHub repository of ImageMagick hosts the source code for all versions of the software. Please note, the following command serves as an example. Replace the x.x.x-x part of the URL with the version number of ImageMagick you wish to install.

wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/x.x.x-x.tar.gz

Step 3: Extract the ImageMagick Archive on Rocky Linux

After downloading the ImageMagick archive, you need to extract its contents. The tar command below serves this purpose. Replace <imagemagick archive> with the name of the downloaded file.

tar xvzf <imagemagick archive>.tar.gz

Step 4: Move the Extracted ImageMagick Directory on Rocky Linux

To organize the file structure better, it’s recommended to move the extracted ImageMagick directory to a more suitable location. Here, we’re using /usr/local/share for this purpose, but you can choose a different location if you prefer.

sudo mv ImageMagick-*.* /usr/local/share/imagemagick

Step 5: Navigate to the ImageMagick Directory on Rocky Linux

Next, navigate into the ImageMagick directory in /usr/local/share/imagemagick using the cd command:

cd /usr/local/share/imagemagick

Step 6: Configure the Build For ImageMagick on Rocky Linux

Within this directory, initiate the configuration for the build process. This is done using the ./configure command:

./configure

Step 7: Build and Install ImageMagick on Rocky Linux 9 or 8

After successful configuration, the next step is to build and install ImageMagick. This is a two-step process executed with the make and sudo make install commands:

make
sudo make install

Step 8: Update the Shared Library Cache for ImageMagick on Rocky Linux

The final step involves updating the system’s shared library cache. This step ensures that the system recognizes the newly installed libraries that came with ImageMagick. The ldconfig command serves this purpose:

sudo ldconfig /usr/local/share/imagemagick

Step 9: Verify the Installation of ImageMagick on Rocky Linux

With all the steps completed, the last thing to do is to verify the successful installation of ImageMagick. The convert --version command will display the installed version of ImageMagick, confirming its successful installation:

convert --version
ImageMagick Manual Installation Output on Rocky Linux EL9 Screenshot
Screenshot showcasing the manual installation process output of ImageMagick on Rocky Linux 9.

Overview of Commands for ImageMagick on Rocky Linux 9 or 8

ImageMagick’s powerful command-line interface is a key aspect of its appeal. With a range of commands at your disposal, you can perform a variety of image processing tasks. Below, we provide a concise overview of some commonly used commands and their functions:

CommandDescription
convertThe convert command is ImageMagick’s main workhorse. It’s used for converting image formats, resizing, blurring, cropping, despeckling, dithering, drawing, and many other operations.
mogrifyThe mogrify command is similar to convert, but it edits images in place, meaning it overwrites the original file with the processed image. This command is useful when you need to apply the same changes to multiple images.
compositeThe composite command is used for merging two images together. It’s handy for tasks like watermarking images or creating composite images.
montageThe montage command is used to create a composite image by combining several separate images. It’s particularly useful for creating contact sheets or photo collages.
identifyThe identify command is used to describe the format and characteristics of one or more image files. It provides a variety of information, including the image’s format, dimensions, color space, and more.
compareThe compare command is used to mathematically and visually annotate the difference between an image and its reconstruction.
streamThe stream command is a lightweight utility to extract pixel data from large images.
displayThe display command is used to display an image or image sequence on any X server. It allows you to manipulate the image in a variety of ways.
importThe import command is used to capture some or all of an X server screen and save the image to a file. This is useful for taking screenshots.

It’s worth noting that this is just a brief overview of what ImageMagick commands can do. Each command has a plethora of options that you can use to fine-tune your image processing tasks.

Closing Thoughts

Taking a step back, we’ve covered some key aspects of ImageMagick, highlighting its versatility in handling a wide array of image formats, its robustness in providing a comprehensive suite of image processing operations, and its flexibility with cross-platform support. Installing ImageMagick on Rocky Linux, whether it’s version 9 or the older Enterprise 8 series, extends the utility of your Linux system, opening up new possibilities in image manipulation. This installation guide has laid the groundwork for you to start exploring and utilizing ImageMagick’s powerful features.

Remember, the journey doesn’t stop here. The commands overviewed serve as a starting point. As you delve deeper into ImageMagick, you’ll uncover a rich array of options and parameters to refine your image manipulation tasks to a tee.

Leave a Comment


Your Mastodon Instance
Share to...