These notes were for a job I am no longer at and are very dated. Please go to the imagemagick website for updated instructions.
The version of ImageMagick that is installed when you run apt-get install imagemagick
on Ubuntu 14.04 is older than I would like.
$ convert --version
Version: ImageMagick 6.7.7-10 2016-06-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
To get a more recent version I can either pull down a binary or build from source. The binaries available on the site, found here, are for:
- Redhat / CentOS 7.1 x86_64 RPM
- Solaris Sparc 2.11
- Cygwin
- MinGW
I'm most comfortable with ubuntu so I'll build from source.
The official installation instructions can be found here I had some trouble getting the png library to work so, these are my notes
- remove version installed with
apt-get
- install dependencies
- download ImageMagick source
- build source
- install and verify
Use the package manager you used to install imagemagick
to uninstall it.
# you may not need sudo
sudo apt-get remove imagemagick && sudo apt-get autoremove
- Install dependencies
sudo apt-get install build-essential
sudo apt-get build-dep imagemagick -y
Some instructions added libpng12-dev
and libjpeg-dev
but, build-dep
covered that. If things don't workout for you, maybe adding them will fix your issue.
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xzvf ImageMagick.tar.gz
the wget
command downloads the latest ImageMagick archive to your current directory and the tar
command extracts the files to the same directory.
cd ImageMagick-6.8.9-1/
./configure
When the configuration is finished, scroll up a bit and check that the correct delegate libraries(plugins) were added. I need .jpeg
and .png
support so I'm going to make sure the rightmost column on their rows said, yes
. Here is the relevant section of my output.
Delegate Library Configuration:
BZLIB --with-bzlib=yes yes
Autotrace --with-autotrace=no no
DJVU --with-djvu=yes yes
DPS --with-dps=yes no
FFTW --with-fftw=yes yes
FLIF --with-flif=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes yes
FreeType --with-freetype=yes yes
Ghostscript lib --with-gslib=no no
Graphviz --with-gvc=yes no
JBIG --with-jbig=yes yes
JPEG v1 --with-jpeg=yes yes
LCMS --with-lcms=yes yes
LQR --with-lqr=yes yes
LTDL --with-ltdl=yes no
LZMA --with-lzma=yes yes
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes yes
OpenJP2 --with-openjp2=yes no
PANGO --with-pango=yes yes
PERL --with-perl=no no
PNG --with-png=yes yes
RAQM --with-raqm=yes no
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
WEBP --with-webp=yes no
WMF --with-wmf=yes yes
X11 --with-x= yes
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes
if the necessary delegates are not added, you'll need to add those before you build. I'd love to tell you how, but I didn't have to do that so I didn't dig into it.
Compile the source with make
.
make
sudo make install
convert --version
when running convert --version to confirm installation after make install, I got the following error
convert: error while loading shared libraries: libMagickCore-7.Q16HDRI.so.2: cannot open shared object file: No such file or directory
running sudo ldconfig /user/local/lib
cleared it up
convert --version
Version: ImageMagick 7.0.4-7 Q16 x86_64 2017-02-06 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
I am also getting the error
E: You must put some 'source' URIs in your sources.list
what is the source that I need to add to sources.list? Is it just the line deb-src?