Issues with Openjpeg delegate

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
sanchi4u
Posts: 3
Joined: 2014-09-22T11:52:03-07:00
Authentication code: 6789

Issues with Openjpeg delegate

Post by sanchi4u »

Hi,

I have installed ImageMagick 6.8.9-7 on my Mac OS X 10.9 Mavericks. I want to convert jpeg 2000 files to other formats such as tiff or png. When I installed ImageMagick, I have delegates for jpeg, png and tiff but not jpeg 2000. So I tried installing Openjpeg from various sources. First I installed Openjpeg 2.1 from Mac ports and rebuilt ImageMagic, but it did not work. Then I manually installed Openjpeg 2.0 and re-installed ImageMagick, but this also doesn't work.

After "./configure", I see that OpenJP2 does pass the test (Excerpt from terminal pasted below).

Delegate Configuration:
BZLIB --with-bzlib=yes yes
Autotrace --with-autotrace=no no
Dejavu fonts --with-dejavu-font-dir=default none
DJVU --with-djvu=yes no
JBIG --with-jbig=yes no (failed tests)
JPEG v1 --with-jpeg=yes no (failed tests)
JPEG-2000 --with-jp2=
LZMA --with-lzma=yes yes
Magick++ --with-magick-plus-plus=yes yes
OpenEXR --with-openexr=yes no
OpenJP2 --with-openjp2=yes yes

However post "make" and "sudo make install" when I check for the delegates with "convert -list configure", I get only the following:

DELEGATES bzlib jng jpeg png tiff xml zlib

Can someone please reflect on this and help me.

Also can ImagMagick handle large file conversions, say of the order of 500 MB?

Thanks !!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issues with Openjpeg delegate

Post by snibgo »

sanchi4u wrote:Also can ImagMagick handle large file conversions, say of the order of 500 MB?
Yes. I regularly convert files of 200 MB with no problem. The limit comes from available disk space. For decent speed, the limit comes from available memory. (The limit really comes from the number of pixels, not the file size.)

Just for fun, I have converted images that took 1 TB of memory. This is about 100 Gpixels.

Sorry I can't answer your other questions.
snibgo's IM pages: im.snibgo.com
sanchi4u
Posts: 3
Joined: 2014-09-22T11:52:03-07:00
Authentication code: 6789

Re: Issues with Openjpeg delegate

Post by sanchi4u »

Thanks for answering that part of the question at least !!!!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues with Openjpeg delegate

Post by fmw42 »

I am on a Mac OSX and install all my delegated libraries from MacPorts, but I install IM manually from source. I have openjpeg @2.1.0_0 installed from MacPorts and it works fine for me with my manually installed IM. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202

I am not sure why you might be having trouble with the MacPorts install of IM, unless it is not compiled with openjpeg.

My understanding is that you must use openjpeg 2.1 or higher, because MacPorts only fixed the issue with naming conventions of openjpeg files at that version.
sanchi4u
Posts: 3
Joined: 2014-09-22T11:52:03-07:00
Authentication code: 6789

Re: Issues with Openjpeg delegate

Post by sanchi4u »

snibgo wrote: Yes. I regularly convert files of 200 MB with no problem. The limit comes from available disk space. For decent speed, the limit comes from available memory. (The limit really comes from the number of pixels, not the file size.)
Just for fun, I have converted images that took 1 TB of memory. This is about 100 Gpixels.

I have been trying to convert a 500 MB Jpeg2000 compressed file (number of pixels would be ~ 20GB). I have even tried on systems with 16GB RAM, still I get memory error. Could you please let me know how you have converted images that took 1 TB of memory.

Thanks !!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issues with Openjpeg delegate

Post by snibgo »

sanchi4u wrote:(number of pixels would be ~ 20GB)
"GB" means "Giga Bytes" or 1000 million bytes.

I use "Gpixels" as shorthand for 1000 million pixels.

ImageMagick Q16 takes about 8 bytes of memory per pixel. A simple convert needs only one copy of the image in memory. 20 Gpixels need 160 GB. If this is larger than the free RAM memory on your computer, IM will use disk. In Windows, by default it uses the location %TEMP%.

For very large images, my %TEMP% doesn't have enough free space. So I connect an external hard drive H: with an empty directory H:\temp. Then I tell IM to use that for temporary storage:

Code: Select all

convert -define registry:temporary-path=H:\temp logo: -resize 100000x100000 logo.miff
Here, we have 10 GPixels. This takes 80 GB of memory. It actually creates a 60 GB temporary file in H:\temp.

Disk is much slower than RAM. IM builds the entire image in memory. Other tools (such as vips/nip2) process images in chunks, where each chunk fits in RAM, so can be very much faster.

See also http://www.imagemagick.org/script/archi ... tera-pixel
snibgo's IM pages: im.snibgo.com
Post Reply