0

I want to convert images with format jpx and jpf to jpg on Ubuntu 16.

After some research i found out that it is require jp2 delegate. Right now when i executed command

convert -list configure | grep DELEGATES

i got this

bzlib djvu mpeg fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pango png ps rsvg tiff wmf x xml zlib

How can i install jp2 delegate on my system? Or if any other way to convert jpf and jpx to jpg, Please suggest me.

1 Answer 1

2

Updated Answer

I am trying to get this working more simply, but only have a limited understanding of Ubuntu Package Managers. Here is my current, simplest, working solution.

Step 1 - Install OpenJPEG2000 and all the build tools

Install v2.1 of OpenJPEG2000 Ubuntu 16 with:

sudo apt-get remove --purge libopenjp2-7 libopenjp2-7-dev
sudo apt-get install libopenjp2-7 libopenjp2-7-dev
sudo apt-get install build-essential pkg-config

Step 2 - set PKG_CONFIG_PATH

That is good and it is the one ImageMagick needs, however, it seems maybe to be in a different place from where ImageMagick expects it. It is not in /usr/lib nor /usr/local/lib, but rather it is here:

/usr/lib/x86_64-linux-gnu/libopenjp2.so.7
/usr/lib/x86_64-linux-gnu/libopenjp2.so
/usr/lib/x86_64-linux-gnu/pkgconfig/libopenjp3d.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/libopenjp2.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/libopenjpip.pc
/usr/lib/x86_64-linux-gnu/openjpeg-2.1
/usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.0

So, set your PKG_CONFIG_PATH

export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib/x86_64-linux-gnu/pkgconfig

Step 3 - Install and build ImageMagick from source

cd
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar -xzvf Im*gz
cd Image*[0-9]
./configure
make clean
make -j 8
sudo make install

Original Answer - which works but is cumbersome

Well, this was painful to work out but it works! Ubuntu 16 LTS

First, remove any dead versions of ImageMagick installed via apt-get.

sudo apt-get remove --purge imagemagick

Then, make sure you have all the packages you need to build software with:

sudo apt-get install build-essential cmake pkg-config

Next, install JPEG200 library, version 2.1 or better!!!!

cd
wget https://github.com/uclouvain/openjpeg/archive/v2.1.2.tar.gz
gunzip open*gz
tar -xvf open*tar
cd open*2
mkdir build               # Out of source builds are preferred
cd build
cmake --prefix=/usr ..
make clean
make -j 8
sudo make install

Now, install ImageMagick:

cd
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
gunzip Image*gz
tar -xvf *agick*tar
cd ImageMagick-7.0.4-6/
./configure --prefix=/usr
make clean
make -j 8
sudo make install

Now test:

identify -list configure | grep DEL
DELEGATES      mpeg jpeg openjp2 ps
2
  • Thanks Mark, I tried this and it works, but i can't use this solution. Can you tell me a solution directly via sudo apt-get install ******* command? Feb 2, 2017 at 5:57
  • Sorry, I don't know enough about Ubuntu's package management system, yet. Maybe if we can get OpenJPEG2000 v2.1 packages.ubuntu.com/yakkety-updates/libopenjp2-7 installed first, then ImageMagick v7 afterwards, it will just work. The answer MAY include PPAs but I have never added one of those either. I will dink around on my VirtualBox Ubuntu later and see what I can do. Feb 2, 2017 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.