ImageMagick is a free and cross-platform application for creating, converting, and modifying raster images. It reads and writes images in a wide range of formats including JPEG, PNG, SVG, WebP, PDF, TIFF, EXR, and GIF to mention just a few.
With ImageMagick, you can flip, resize, rotate, mirror, distort, and transform images as well as apply effects such as adjusting image colors and drawing lines, text, and shapes on images.
ImageMagick is absolutely open source meaning that you can use, modify and redistribute it under the Apache 2.0 license.
In this guide, we learn how to install the latest ImageMagick on Ubuntu 22.04. There are two ways of installing ImageMagick. You can install it from the default Ubuntu repositories or install it from the source.
Method 1: Install ImageMagick using APT
The easiest way to install ImageMagick is using the Apt command from the Ubuntu default repository.
Step 1: Update Ubuntu
First, refresh the local package index as follows
sudo apt update
Step 2: Install ImageMagick using Apt
Next, install ImageMagick using the APT package manager.
sudo apt install imagemagick
Step 3: Verify ImageMagic Installation
By checking the ImageMagick version we can confirm that it is installed.
ImageMagick version 6.9.11 is installed from the Apt repository.
Method 2: Install ImageMagick from source
Installing ImageMagick from the official Ubuntu repositories usually does not provide with the latest version of ImageMagick. To install the latest version of ImageMagick download the source file and compile it.
Follow the steps to install ImageMagick from the source.
1. Install prerequisite packages
To compile from the source, first, install the build tools as follows.
sudo apt install build-essential make gcc
Install your required development delegate libraries:
Note: Recommend checking the required list of all development libraries by a dry run apt -s build-dep imagemagick. Make sure to add 'deb-src' URIs in your sources.list file.
2. Download ImageMagick
Download the latest tarball file from the ImageMagick Download page using the following command:
Alternatively, check the version of ImageMagick using the convert command:
convert -version
From the output, you can see that we are running ImageMagick 7.1.0-36 which is the latest version at the time of publishing this guide.
By default, ImageMagick installs binaries in the /usr/local/bin directory. Library files are stored in /usr/local/lib and header files in the /usr/local/include path.
You can also check out the documentation in the /usr/local/share directory.
You can also test ImageMagick, run the following command
convert logo: logo.gif
The command converts the ImageMagick logo into a GIF and places it on your Desktop directory.
You can use the GNOME search functionality to open the ImageMagick application.
This launches ImageMagick, this time with an additional tray of command options for achieving various tasks.
Conclusion
In this guide, we learned how to install ImageMagick on Ubuntu 22.04. We used two approaches - installing from the official Ubuntu repositories and installing from the source.
Thanks for reading, feel free to provide your feedback and suggestions.
If this resource helped you, let us know your care by a Thanks Tweet.
Did you find this article helpful?
We are glad you liked the article. Share with your friends.
Comments