Page 1 of 1

ImageMagick lossless JPEG2000 compression of 10-bit per component images is wrong

Posted: 2016-03-15T16:52:09-07:00
by JoakimZiegler

Code: Select all

Version: ImageMagick 6.9.3-7 Q16 x86_64 2016-03-13 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jp2 lcms pangocairo png tiff x xml zlib
See discussion here: https://imagemagick.org/discourse-serve ... 59#p131059

Basically, while JPEG2000 compression works as expected with 8-bit and 16-bit images, it fails for 10-bit images, the output image is not identical to the original. Confirmed by two different people. OpenJPEG's own compression utility does generate a lossless 10-bit JPEG2000 file that's identical to the original, so this is likely a bug in ImageMagick.

Re: ImageMagick lossless JPEG2000 compression of 10-bit per component images is wrong

Posted: 2016-03-15T17:20:29-07:00
by JoakimZiegler
I did some additional testing. This also fails for 12-bit and 14-bit depth TIFF images to JPEG2000. (I'm basically using ImageMagick to do convert image-16b.tif -depth 12 image-12b.tif and so on, then compressing those output images to JPEG2000).

Additionally, using a 12-bit TIFF as input when converting to JPEG2000 gives the following warning message:

Code: Select all

convert: Deprecated fields cp_cinema or cp_rsiz are used
Please consider using only the rsiz field
See openjpeg.h documentation for more details
 `OpenJP2' @ warning/jp2.c/JP2WarningHandler/236.