JPEG2000 Compressed TIFF problem

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
footnoter

JPEG2000 Compressed TIFF problem

Post by footnoter » 2010-08-06T09:27:40-07:00

I am trying to compress a TIFF file but selecting JPEG2000 compression leaves the file uncompressed (convert myfile.tif -compress JPEG2000 compressed.tif). The JPEG and LZW compression filters work just fine (resulting in a valid TIFF that is compressed). Any idea why it won't do the JP2 compression or how to make this work? I turned on the debug option but didn't see anything useful.

If I convert the file type to JP2 then the JPEG2000 compression does get applied to the resulting file (convert myfile.tif -compress JPEG2000 compressed.jp2). So I know that JPEG2000 compression is available.

User avatar
fmw42
Posts: 25764
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 Compressed TIFF problem

Post by fmw42 » 2010-08-06T10:13:54-07:00

I know little about that, except JP2000 is a lossless compression.

How do you know the JP2000 compression is not working?

Does IM allow JP2000 compression for TIFF? I don't see anything about it in http://www.imagemagick.org/Usage/formats/#tiff, although that page may not be definitive.

If you are trying to use JP2000, then do you have the Jasper delegate library installed?

convert -list configure

should list jasper in the DELEGATES line.

That is the best I can offer as not an expert on JP2000. Perhaps someone else more knowledgeable can give you more insight.

footnoter

Re: JPEG2000 Compressed TIFF problem

Post by footnoter » 2010-08-06T12:19:54-07:00

I know that the resulting TIFF is not compressed because of its file size and because "identify" says that compression=none. I know that we have the Jasper module working because if the resulting format is jp2 then it is jp2 encoded w/ jp2 compression. Perhaps I need to configure something so that the TIFF encoder knows what module to use for JPEG2000 compression? Either that or it is impossible today.

User avatar
fmw42
Posts: 25764
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 Compressed TIFF problem

Post by fmw42 » 2010-08-06T12:28:21-07:00

Have you verified using some other tool such as exiftool, to see if that shows the correct compression. Perhaps IM verbose info is not reporting it correctly.

footnoter

Re: JPEG2000 Compressed TIFF problem

Post by footnoter » 2010-08-06T12:42:20-07:00

Yes, I verified with Irfanview. Also, the image size is slightly greater than the original image and if it were compressed it would be smaller.

Well, I looked into tiff.c and I can see that the compression type of JPEG2000 is being ignored. So it looks like it is going to take some coding to modify tiff.c so it can handle this compression. Does anyone know Jasper well enough to suggest how to get started?

Wolfgang Woehl
Posts: 34
Joined: 2010-02-25T15:22:50-07:00
Authentication code: 8675308

Re: JPEG2000 Compressed TIFF problem

Post by Wolfgang Woehl » 2010-08-07T00:26:39-07:00

footnoter wrote:I am trying to compress a TIFF file but selecting JPEG2000 compression leaves the file uncompressed
I don't know if ISO 12369:2004 (Tag image file format for image technology) allows for JPEG 2000 compression. Pretty sure, though, that next to no TIFF apps would.

Wolfgang Woehl
Posts: 34
Joined: 2010-02-25T15:22:50-07:00
Authentication code: 8675308

Re: JPEG2000 Compressed TIFF problem

Post by Wolfgang Woehl » 2010-08-07T00:29:15-07:00

fmw42 wrote:... except JP2000 is a lossless compression.
JPEG 2000 output can range from mathematically lossless to "extremely" lossy.

Wolfgang Woehl
Posts: 34
Joined: 2010-02-25T15:22:50-07:00
Authentication code: 8675308

Re: JPEG2000 Compressed TIFF problem

Post by Wolfgang Woehl » 2010-08-07T00:36:24-07:00

Well, see http://www.digitalpreservation.gov/form ... tags.shtml and http://www.awaresystems.be/imaging/tiff ... ssion.html which says (bottom of the page):
LibTiff adds support for some compression schemes that are not part of the specification and are somewhat less common. Here's LibTiff's definition of possible values: [...] COMPRESSION_JP2000 = 34712;

Post Reply