Last updated: February 12, 2019
ImageMagick: Manipulating Graphics From The Command-Line?
Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
ImageMagick is a free and open-source software collection of command-line tools for manipulating graphics files. It also works as a graphics processing library for a number of programming languages.
Brief History of ImageMagick
Development on ImageMagic was started in 1987, by John Cristy during his work at DuPont. It all started with a request by David Pensak from DuPont to display computer-generated images with 24-bit color on an 8-bit computer monitor capable of displaying only 256 colors.
Back in 1987, computer monitors capable of displaying 24-bit color where very expensive and quite rare. John Cristy successfully implemented an algorithm to reduce 24-bit images to 8-bit images, or from 16.7 million to just 256 colors.
Cristy went on to tackle many similar computer graphics oriented tasks during his years at DuPont.
By 1990, John Cristy decided to freely release the image processing tools. At that time, there were only a few free image processing tools available. But before the free release, John Cristy had to get approval from DuPont management for the release.
Luckily, the DuPont management agreed, and transferred the software copyright to ImageMagick Studio LLC.
ImageMagick was first released to the public and posted to Usenet in August, 1990.
What are the uses for ImageMagick?
Most of us are used to editing images using a graphical user interface (GUI) in modern tools like gimp or Photoshop. Manipulating images with command-line tools, that certainly seems very odd nowadays, doesn’t it?
Actually, for some tasks GUI tools are not the best choice. These are mostly batch operations. For example, it is easier to use a command-line tool if you need to convert hundreds of images from one file format to another.
ImageMagick can also dynamically process images from web scripts. These and many other similar tasks can be easily automated using ImageMagick command-line tools.
ImageMagick also has many integrated bindings so that it can be used from within a range of programming languages. Many programs and CMS solutions can also use ImageMagick for image processing, for example in the creation of image thumbnails.
ImageMagick was originally designed as an image to image converter, and it can accurately convert just about any image format to any other image format.
Besides converting, ImageMagick is also a library of image processing algorithms that can be used directly from a command-line or accessed via a large number of programming languages like C, C++, Perl, Ruby, PHP, and so on.
ImageMagick allows users to combine batch image processing operations in a script, so the same set of operations can be applied to many images, or used as a sub-system tool for other applications, like web apps, video processing tools, and other graphics tools.
The list of supported image transformations in ImageMagick is impressive, with features like color quantization, posterization, dithering, halftone dithering, liquid rescaling, transparency, GIF animation, blur, sharpen, composite, etc.
ImageMagick can also use OpenCL to utilize your Graphics Processing Unit (GPU) for image processing, which tends to improve performance on OpenCL-capable systems.
The Q8 version supports up to 8-bit per pixel component (24- or 32-bit color, depending on whether or not the image has an Alpha channel), while the Q16 version supports up to 16-bit per pixel component (48- or 64-bit color).
ImageMagick is thread safe and most algorithms execute in parallel on multi-core CPUs.
ImageMagick runs on Linux, Windows, Mac OS X, iOS and Android operating systems.
ImageMagick is free and open source, distributed under the Apache 2.0 license. This means that you may use, copy, modify, and distribute the source code in both open and proprietary applications.
Detailed installation instructions for all supported platforms are available on the official ImageMagick web site. The latest stable release of ImageMagick is version 18.104.22.168, with ImageMagick version 7 also available in beta stage.
If you want to make it really easy on yourself, you can get a host that provides ImageMagick. Check out our ImageMagick Hosting Compare page to find the right hosting company for you.
Transforming images using a command-line interface is not an everyday task, so learning how to efficiently use ImageMagick can be tricky, especially if you are only used to GUI graphics tools.
ImageMagick Tutorials and Resources
When using ImageMagick’s powerful command-line tools for the first time, official resources and tutorials can be very helpful. We have chosen some tutorials and learning resources that will help you learn ImageMagic command-line syntax:
- Command-Line Option manual is a full description and reference of ImageMagick’s command-line interface.
- Examples of ImageMagick Usage present a set of examples using ImageMagick from the command-line. However, they also illustrate what can be done using the ImageMagick Application Programming Interface (API).
- ImageMagick Users Guide is a PDF version of the early ImageMagick user guide. Although it is a bit outdated, it can still come in handy.
- List of ImageMagick API’s shows all of the different API’s available with ImageMagick, with links to the resources.
Only a few books about ImageMagick are available, and they can be useful resources. Still, we suggest that you try some free online resources and tutorials before buying a book.
- The Definitive Guide to ImageMagick by Michael Still explains how ImageMagick’s features can be incorporated in a variety of applications. This book is intended for beginner to intermediate programmers and web designers looking for an automated solution for image manipulation.
- ImageMagick Tricks: Unleash the power of ImageMagick with this fast, friendly tutorial and tips guide by Sohail Salehi is packed with examples of photo manipulations, logo creation, animations, and complete web projects. The chapters consist of workshops, each one applying a set of ImageMagick commands to produce surprising and exciting results.
At its heart, ImageMagick is a throwback to the years of 8-bit graphics, but that does not mean it is outdated or of limited use. In fact, ImageMagick is still widely used in certain niches.
Naturally, it is no replacement to proper photo editing suites, but that’s sort of the whole point — ImageMagick is designed to handle other stuff, and it excels at mass, match operations.
While it’s a relatively old solution, ImageMagick is still being developed, and allows for no-nonsense integration via its APIs. If you need to convert loads of images at once, without having to mess about in elaborate graphics tools, it’s worth a try.