Page 1 of 1

JPEG2000 Compressed TIFF problem

Posted: 2010-08-06T09:27:40-07:00
by footnoter
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.

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-06T10:13:54-07:00
by fmw42
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.

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-06T12:19:54-07:00
by footnoter
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.

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-06T12:28:21-07:00
by fmw42
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.

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-06T12:42:20-07:00
by footnoter
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?

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-07T00:26:39-07:00
by Wolfgang Woehl
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.

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-07T00:29:15-07:00
by Wolfgang Woehl
fmw42 wrote:... except JP2000 is a lossless compression.
JPEG 2000 output can range from mathematically lossless to "extremely" lossy.

Re: JPEG2000 Compressed TIFF problem

Posted: 2010-08-07T00:36:24-07:00
by Wolfgang Woehl
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;