If you are an editor and editing images is part of your daily life, then you should try the ImageMagick tool.
ImageMagick is a free and open-source tool to edit, create, compose or convert digital images into another format. It supports over 200 formats, including PNG, JPEG, GIF, WebP, HEIC, SVG, PDF, DPX, EXR, and TIFF.
How to Install ImageMagick or Imagick PHP Extension in Linux
It provides various editing tools such as resizing, flipping, mirroring, rotating, distorting, shearing, and transforming images, adjusting image colors, applying multiple special effects, drawing text, lines, polygons, ellipses, and Bézier curves.
Installation of ImageMagick 7 on RHEL/Fedora/AlmaLinux
For RHEL-based distributions such as Fedora, Alma Linux, or CentOS, users can easily install ImageMagick 7 using the below methods.
Installing ImageMagick 7 from the Repository
Installing ImageMagick 7 from Source Code
Installing ImageMagick 7 from the Repository
Three packages need to be installed to use ImageMagick in RHEL-based distributions such as RHEL/Fedora/CentOS or Alma Linux.
ImageMagick
contains the complete ImageMagick tool.ImageMagick-devel
contains the library links and header files required while developing ImageMagick applications.ImageMagick-perl
provides support for Perl script that uses ImageMagick to read, manipulate, or write an image or image sequence within a Perl script.
Execute the below command to install all the packages on your RHEL/Fedora/CentOS/Alma Linux system.
$ sudo dnf install ImageMagick ImageMagick-devel ImageMagick-perl
After the installation is completed, execute the below command to verify the existence of the ImageMagick on your system by checking the version of the application.
$ identify --version
OR
$ convert --version
Below is the output of the above command.
Removing ImageMagick 7 Installed from the Repository
If you wish to remove it from your system altogether, execute the below command to remove ImageMagick
, ImageMagick-devel
and ImageMagick-perl
packages.
$ sudo dnf remove ImageMagick ImageMagick-devel ImageMagick-perl
Installing ImageMagick 7 from Source File
Installation of ImageMagick 7 from the source file requires installing a development tool on your system. This development tool includes all the necessary packages to compile and build the application on RHEL-based distributions.
Execute the below command to install development tools on your RHEL-Based distributions.
$ sudo yum groupinstall 'Development Tools'
After the development tools are installed, grab the latest ImageMagick.tag.gz package from the official site, or you can use the wget command to download the compressed file from your terminal app.
$ wget https://download.imagemagick.org/ImageMagick/download/ImageMagick.tar.gz
After downloading the package, uncompress and move it into the directory using the following command.
$ tar xvf ImageMagick.tar.gz
$ cd ImageMagick-[*]/
Replace [*] with your directory version, then execute the below command to configure the source before compilation.
$ ./configure
After the configuration is finished, start the compiling process with the following command.
$ make
If the compilation is finished without throwing any errors, you are ready to install it and configure dynamic linker run-time bindings on your system using the following command.
$ sudo make install
$ sudo ldconfig /usr/local/lib
Finally, you can check the version of the magick to confirm the installation.
Removing ImageMagick 7 Installed from the Source File
To remove the ImageMagick installed via compilation and building from the source file, move into the source file directory used for compilation in step 2 and execute the below command.
$ sudo make uninstall
You can ask us in the comment section if you have any queries.
Innovative tech mind with 12 years of experience working as a computer programmer, web developer, and security researcher. Capable of working with a variety of technology and software solutions, and managing databases.