I want to use ImageMagick to convert some files from jp2 (JPEG-2000) to jpg. The command to do that is fine, but I don't know how to enable the jp2 delegate in ImageMagick.
I installed ImageMagick via package manager: sudo apt-get install ImageMagick
.
I'm using ImageMagick 6.8.9-9, this is the most up to date version of ImageMagick available from apt-get
.
Currently, a lot of the main file types are automatically included. The following libraries have built-in support and are listed as delegates:
bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
Edit: I should have mentioned, I did try file conversions before starting to wrangle with openjpeg-2
. A command like convert input.jp2 output.jpg
gives me the error message:
convert: no decode delegate for this image format `JP2' @ error/constitute.c/ReadImage/501.
So, I need to get jp2 working. The relevant library is openjpeg-2
, and ImageMagick's delegates page gives the tarball, openjpeg-2.0.0.tar.gz
.
Okay, so I downloaded it and followed the instructions to install given in the install file. Normal stuff: cmake .
, sudo make install
.
But now, how do I configure ImageMagick so that it 'picks up' open-jpeg-2.0.0
? Do I have to rebuild ImageMagick from source to do so? Or is there a command I can enter to get ImageMagick to enable it? Or a file I should change, etc?
I have spent ages and ages looking into this, read many Q&As online, but I still did not crack it. It is an issue of my Linux knowledge rather than something to do with ImageMagick per se, so I would really appreciate it if someone can help me figure out what the missing step is here. Thank you.
gm convert in.jp2 out.jpg