How to Install ImageMagick on Ubuntu 20.04 | 18.04

How to Install ImageMagick on Ubuntu 20.04 | 18.04

In this article, we are going to shows how to Install ImageMagick on Ubuntu 20.04 | 18.04 . If you are interested to Install ImageMagick on Ubuntu then this post is ideal for you.

ImageMagick is a popular, free, open source and cross-platform software tool which is used for image manipulation. With the help of it, you can read and write images in different kind of formats (over 200) such as GIF, JPEG, PNG, Postscript, and TIFF.

You can use the ImageMagick to create, edit, compose, or convert digital images. It can resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects and many more.

For more details about mageMagick, please check its official page.


How to Install ImageMagick on Ubuntu

You can install ImageMagick on Ubuntu using below two methods:

  • Install ImageMagick using the apt package repository
  • Install ImageMagick using the source file

Method 1 : Installing ImageMagick using APT

Installing ImageMagick via apt package management tool from Ubuntu’s default repositories is the easiest way to install it. Using apt, you can install the latest stable version of ImageMagick in your Ubuntu system.

To install ImageMagick from apt, first update the default package index:

sudo apt update

After that, run the command below to install ImageMagick:

sudo apt install imagemagick

When ask, Type ‘ y ‘ and click Enter key to allow additional disk space.

Once the installation is complete, verify the installation by running the command below:

convert logo: logo.gif

The command above will create a file named logo.gif in your Home directory. If the file is created in your Home directory that means the ImageMagick is successfully installed.


Method 2 : Install ImageMagick using the source file

You can also install the ImageMagick from the source file which will allow you to install the latest ImageMagick version. To install ImageMagick from the Source, simply follow below steps:

First of all, install the build-essentials tools to run ImageMagick:

sudo apt install build-essential

After that, download the source files of ImageMagick from its official website using the command below:

wget https://www.imagemagick.org/download/ImageMagick.tar.gz

Next, extract the downloaded file using the command below:

tar xzvf ImageMagick.tar.gz

After extract the file, change the director to the ImageMagick source directory by running the command below:

cd ImageMagick-7.1.0-0/

After that, run the command below to compile and configure ImageMagick:

./configure

Next, run the make command:

sudo apt install make
make

After compilation process, run the command below to install ImageMagick:

$ sudo make install

At last, you will need to configure the dynamic linker run-time bindings by running command below:

sudo ldconfig /usr/local/lib

To verify the installation of ImageMagick, run the command below:

magick --version
output
Version : ImageMagick-7.1.0-0

Install imagick PHP Extension

In the above steps or methods, you have successfully installed ImageMagick on your Ubuntu system. Next, if you want to install Imagick PHP extension for use it through PHP code, run the command below:

sudo apt install php-imagick

Next, restart Apache by running command below:

sudo systemctl restart apache2

To verify the Installation, run the command below:

php -m | grep imagick
Output
imagick

That’s all

If you face any error and issue in above steps , please use comment box below to report.

If our tutorials helped you, please consider buying us a coffee. We appreciate your support!

Thank you for your support.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top