Compile ImageMagick with JPEG2000 support

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Compile ImageMagick with JPEG2000 support

Post by ^rooker »

I've discovered a strange oddity (or bug?) in the ImageMagic v6.3.7 available in Ubuntu Hardy with lossless JPEG 2000 conversion: It ain't lossless, because *some* bytes are reduced by the 1 (e.g. 8B => 8A).

I'm currently evaluating if it's a bug and if it's still an issue in v6.5.8-4 (Dec 2009).

In order to compile ImageMagick with JPEG 2000 support, I've had to install the following packages:

Code: Select all

sudo apt-get install libjasper-dev libjpeg62 libperl-dev
Download the ImageMagic source, unpack it and tell the "configure" script to put it in an optional directory, so it won't collide with the already installed, older version - then compile it by running "make":

Code: Select all

./configure --prefix=/opt/imagemagick --with-jp2
make
(JP2 support should be turned on by default, but I've added "--with-jp2" just to be sure)

If JPEG and JPEG-2000 support is properly enabled, the output of ./configure should contain these lines:
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=yes yes
If something went wrong, these formats will be disabled and look like this:
JPEG v1 --with-jpeg=yes no
JPEG-2000 --with-jp2=yes no
Without the libjasper-dev and libjpeg62 package, they're both "no" - regardless if you switch support for them on or not.

Installing it seemed a bit strange, because you can't just install with "checkinstall" as root in one step. I've created the target folder as a regular user and then ran "make install" twice:

Code: Select all

mkdir /opt/imagemagick
sudo chown myuser:myuser /opt/imagemagick
make install
sudo checkinstall make install
Now you should have an independent version of ImageMagick installed in /opt/imagemagick.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply