Peter Murray | 30 Apr 21:56
Favicon

Re: Problems with reversible J2K transform


Thanks for everyone's reply to the previous question about reading
Kakadu-generated JPX files using Photoshop CS3.  The problem does seem
to be universally there for CS2/CS3, although the actual source of the
problem has not been discovered.

That issue, though, is but a side-show to a bigger question.  I'm having
problems with conversions of TIFF to JP2 to derived JPEG for web
presentation.  Along the way I've discovered that the default settings
for both ImageMagick and Kakadu result in irreversible transformations.
 Here is the data:

 http://drc-dev.ohiolink.edu/temp/j2k/AKAG.1925.31.tif
   Source image

 http://drc-dev.ohiolink.edu/temp/j2k/AKAG.1925.31.jasper.tif
  Jasper 1.701 via ImageMagick 6.2.9
   convert AKAG.1925.31.tif -o AKAG.1925.31.jasper.jp2

 http://drc-dev.ohiolink.edu/temp/j2k/AKAG.1925.31.kakadu.jp2
  Kakadu v5.2.6
   kdu_compress -i AKAG.1925.31.tif -o AKAG.1925.31.kakadu.jp2

 http://drc-dev.ohiolink.edu/temp/j2k/AKAG.1925.31.Crev.jp2
  Kakadu v5.2.6
   kdu_compress -i AKAG.1925.31.tif -o AKAG.1925.31.Crev.jp2 \
       Creversible=yes -rate -,1,0.5,0.25 Clevels=5 Corder=LRCP

 http://drc-dev.ohiolink.edu/temp/j2k/AKAG.1925.31.Crev.jpf
  Kakadu v5.2.6
   kdu_compress -i AKAG.1925.31.tif -o AKAG.1925.31.Crev.jpf \
       Creversible=yes -rate -,1,0.5,0.25 Clevels=5 Corder=LRCP

Here is a summary observations:

 * For me, "AKAG.1925.31.Crev.jpf" (or .jpx) is not readable in
   Photoshop ("the file format module cannot process the file"),
   although Graphic Converter on the Mac /can/ read it.

 * On a pixel-by-pixel basis, at high magnification, there are
   differences in the RGB and CMYK values between the TIF and the
   JASPER.JP2 and the KAKADU.JP2 files, but the TIF and the
   Crev.JP2 files appear to be the same.

 * Comparison via copying and pasting the JP2 on top of the TIF
   image and selecting "Difference" blending mode between the
   layers does not result in and looking at the histogram of
   the resulting image shows differences in all cases except
   TIF versus Crev.JP2.  (In the Histogram view, the mean,
   median and standard deviation are all exactly 0.)

 * Using "Images > Calculations..." with 100% opacity difference
   blending between source images (the TIF and the JP2s) with the
   results put into a new document shows in a completely black
   image only for Crev.JP2.

So it would appear that one needs to set parameters in Kakadu's
'kdu_compress' command in order to get lossless compression:

     TIF -x-≥ JASPER.JP2
     TIF -x-≥ KAKADU.JP2
     TIF -=-> Crev.JP2

...and that the same holds true for our grayscale images:

  http://drc-dev.ohiolink.edu/temp/j2k/I_102413519.tif
  http://drc-dev.ohiolink.edu/temp/j2k/I_102413519.Crev.jp2

...except when we have to convert the grayscale to RGB.  We need to do
this at some point because our users are not seeing the TIFF or the JP2
directly -- they are seeing a JPEG derivative.  At extreme
magnification, individual pixel values in the TIF versus the Crev.JP2
show the same K value but different CMYK values.  If I convert the
images to RGB mode in Photoshop and do the same "Image -> Calculation"
operation, I don't get a nice black resulting image back.

CONCLUSIONS
 * Default options for the ImageMagick 'convert' and Kakadu
   'compress' commands do not result in lossless transformations.

 * For our sample images, using Kakadu command line options do
   appear to result in lossless transformations for RGB images.

 * For our sample greyscale images, we have not yet found a way
   to perform a lossless transformation to JPEG2000.

The first two conclusions might be of interest to the group.  Can anyone
help with the third one?

Peter

[1] Ron, this might be something I report to Adobe?  Where are you
reporting bugs?
--
Peter Murray                            http://www.pandc.org/peter/work/
Assistant Director, New Service Development  tel:+1-614-728-3600;ext=338
OhioLINK: the Ohio Library and Information Network        Columbus, Ohio
The Disruptive Library Technology Jester                http://dltj.org/
Attrib-Noncomm-Share   http://creativecommons.org/licenses/by-nc-sa/2.5/

Gmane