UPDATE: I'm now running the AppImage package for ImageMagick. With appimaged installed, setup of ImageMagick on Ubuntu Desktop was frictionless. By linking from from the AppImage to ~/bin I am able to run it in the CLI. The main difference is in the format of the commands. Instead of convert
I invoke magick convert
, which isn't a big deal since convert
was always just an alias for the full command. Getting it all to work on my headless Ubuntu Server required more effort (mostly to get appimaged running), but eventually successful.
Notes on installing ImageMagick from source, because the old version that ships with Ubuntu doesn't support the latest formats (like .webp). The AppImage package fell short for me, so I decided to go with source. This has been tested on Ubuntu 18.04 and 20.04 LTS.
Basically followed the directions here:
https://imagemagick.org/script/install-source.php
See that page for any updates from the developers.
These instructions result in a per-user, rather than global, install to $HOME/.local/ImageMagick.
This build varies only in that it is a per-user rather than a global install.
Note that if you decide to change your installation path (the path specified by "--prefix="), you will have to recompile.
- Remove existing distro binary package if installed:
$ sudo apt remove --purge imagemagick
Note that some other desktop packages (e.g. MATE's caja file manager) require the shipping imagemagick libraries:
imagemagick-6-common
imagemagick-6.q16
Check the output of "apt remove" carefully. Leave the above libraries in place unless you're sure you won't need the packages that require them.
- Get build system dependencies. You probably already have these, but check to make sure:
build-essential
autotools-dev
- Install graphic library packages, including headers (again, you may already have these):
libgif-dev
libjpeg-dev
libjpeg-turbo8-dev
libjpeg8-dev
libpng-dev
libwebp-dev
libfftw3-dev
libfreetype6-dev
libfontconfig1-dev
liblzma-dev
libbz2-dev
libx11-dev
- Get the source (at the time this was writen that was ImageMagick-7.1.0):
$ git clone [email protected]:ImageMagick/ImageMagick.git ImageMagick-7.1.0
Note that the source in tar.gz and zip format for specific versions is available in the Releases section of the GitHub repository, along with that version's Release Notes.
- Change directory into the source folder and configure with modules:
$ cd ImageMagick-7.1.0
$ ./configure --with-modules --prefix=$HOME/.local/ImageMagick
- Compile:
$ make
- Install as user (not as root, files will be copied to $HOME/.local/ImageMagick):
$ make install
- Edit $HOME/.profile to add the following:
MAGICK_HOME=$HOME/.local/ImageMagick
export PATH=$MAGICK_HOME/bin:$PATH
- Either re-source .profile, or log out and back in:
$ source .profile
- Verify the new version is in place:
$ identify -version
Version: ImageMagick 7.1.0-20 Q16-HDRI x86_64 2021-12-31 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr png tiff webp wmf x xml zlib
Compiler: gcc (7.5)
- Try out by trying to convert a file:
$ convert images/logo.jpg images/logo.gif
- Validate the new file:
$ identify images/logo.gif
images/logo.gif GIF 123x118 123x118+0+0 8-bit sRGB 256c 5888B 0.000u 0:00.000
- To update to the latest version, rinse and repeat.
NOTES:
You may also need to install the following packages if they're not already on the system:
llbomp5