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 »

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: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 Compressed TIFF problem

Post 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.
footnoter

Re: JPEG2000 Compressed TIFF problem

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 Compressed TIFF problem

Post 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.
footnoter

Re: JPEG2000 Compressed TIFF problem

Post 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?
Wolfgang Woehl
Posts: 34
Joined: 2010-02-25T15:22:50-07:00
Authentication code: 8675308

Re: JPEG2000 Compressed TIFF problem

Post 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.
Wolfgang Woehl
Posts: 34
Joined: 2010-02-25T15:22:50-07:00
Authentication code: 8675308

Re: JPEG2000 Compressed TIFF problem

Post by Wolfgang Woehl »

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 »

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