How to install ImageMagick in Ubuntu

ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats like GIF, JPEG, PNG, Postscript, and TIFF. We can also use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

Step 1 – Prerequsities

First of all, You need to install the required packages in order to install ImageMagick and Imagick PHP extension.

sudo apt install php php-common gcc
Step 2 – Install ImageMagick

After installing required packages, let’s install ImageMagick using the following command. ImageMagick package is available under default apt repositories.

sudo apt install imagemagick
Step 3 – Install imagick PHP Extension

After installing required packages, let’s install ImageMagick using the following command. ImageMagick package is available under default apt repositories.

sudo apt install php-imagick

For different PHP version’s you need to install the specific version of imagick like php7.1-imagick or php7.3-imagick etc.

Step 4 – Restart Apache and Verify

After completing above steps you need to reload apache service to enable php exension using following command

sudo systemctl restart apache2

Click here to read more details about ImageMagick setup and there uses.

You can also create phpinfo() file to view ImageMagick on the web browser.

install imagemagick in ubuntu

Thats it…

Leave a Reply

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