Convert jpeg2000 image to bigtiff ?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sid
Posts: 4
Joined: 2012-07-30T13:08:05-07:00
Authentication code: 15

Convert jpeg2000 image to bigtiff ?

Post by sid »

I have a JPEG2000 image that I want to convert to a TIFF. The image is 78,000 x 30,462 pixels with a file size a little over 1GB. The size of an uncompressed TIFF obtained from this image is expected to be around 6GB. I have compiled ImageMagick 6.7.8-6with libtiff 4.0.1 which supports bigTIFF and also with libjasper (for jpeg2000 support). This is also confirmed by running ldd:

Code: Select all

ldd `which convert`| grep -E 'jasper|tiff'
	libtiff.so.5 => /usr/local/imagemagick/tiff-4.0.1/lib/libtiff.so.5 (0x00002b6d475f4000)
	libjasper.so.1 => /usr/lib64/libjasper.so.1 (0x0000003242000000)
'identify' is able to correctly report the metadata on my input file :

Code: Select all

identify cmu-2.jp2
cmu-2.jp2 JP2 78000x30462 78000x30462+0+0 8-bit DirectClass 1.1838GB 955.770u 18:34.250
I am using the following command to convert the jpeg2000 image to TIFF :

Code: Select all

convert cmu-2.jp2 /tmp/result.tiff


However, 'convert' exits as soon as the output TIFF exceeds 4GB. How can I specify that the output should be a bigTIFF ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert jpeg2000 image to bigtiff ?

Post by fmw42 »

I am not an expert on tiff and do not know if you need to install a special delegate library for BigTiff, but you might try,

convert cmu-2.jp2 TIFF:/tmp/result.tiff

though I am not sure if that will help or not.

see more details at http://bigtiff.org/

If you run

convert -list format

it should tell you what version of libtiff is installed such that IM sees it, in case you have multiple versions of libtiff.

You might also want to look at http://www.imagemagick.org/Usage/files/#massive
sid
Posts: 4
Joined: 2012-07-30T13:08:05-07:00
Authentication code: 15

Re: Convert jpeg2000 image to bigtiff ?

Post by sid »

Fred : Thanks for the suggestion. Using a specific delegate worked. The key was using the TIFF64 delegate.

Code: Select all

convert -list format  | grep tiff -i
      EPT  EPT       rw-   Encapsulated PostScript with TIFF preview
     EPT2  EPT       rw-   Encapsulated PostScript Level II with TIFF preview
     EPT3  EPT       rw+   Encapsulated PostScript Level III with TIFF preview
   GROUP4* TIFF      rw-   Raw CCITT Group4
     PTIF* TIFF      rw+   Pyramid encoded TIFF
     TIFF* TIFF      rw+   Tagged Image File Format (LIBTIFF, Version 4.0.1)
   TIFF64* TIFF      rw-   Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.1)
Here is the solution that worked :

Code: Select all

convert cmu.jp2 TIFF64:/tmp/result.tiff
Post Reply