Open benjamingeer opened 7 years ago
The reference JPEG 2000 images:
https://drive.switch.ch/index.php/s/kdlHhsjsPOfchRI
The reference TIFF images:
To reproduce with one image:
$ local/bin/sipi -f reference_jp2/jp2_5.tif sipi_file5.jp2
$ compare -metric PAE testfiles_jp2/file5.jp2 sipi_file5.jp2 null:
32382 (0.494118)
$ local/bin/sipi -f testfiles_jp2/file5.jp2 sipi_jp2_5.tif
$ compare -metric PAE reference_jp2/jp2_5.tif sipi_jp2_5.tif null:
32382 (0.494118)
$ local/bin/sipi -f sipi_file5.jp2 sipi_sipi_jp2_5.tif
$ compare -metric PAE sipi_sipi_jp2_5.tif reference_jp2/jp2_5.tif null:
0 (0)
OK here's something really interesting: I get exactly the same results if I convert the files with macOS Preview instead of with Sipi:
$ compare -metric PAE testfiles_jp2/file5.jp2 preview_file5.jp2 null:
32382 (0.494118)
$ compare -metric PAE reference_jp2/jp2_5.tif preview_jp2_5.tif null:
32382 (0.494118)
$ compare -metric PAE reference_jp2/jp2_5.tif preview_preview_jp2_5.tif null:
0 (0)
And I get the same thing if I use ImageMagick to convert the files!
$ convert reference_jp2/jp2_5.tif im_file5.jp2
$ compare -metric PAE testfiles_jp2/file5.jp2 im_file5.jp2 null:
32382 (0.494118)
$ convert testfiles_jp2/file5.jp2 im_jp2_5.tif
$ compare -metric PAE reference_jp2/jp2_5.tif im_jp2_5.tif null:
32382 (0.494118)
$ convert im_file5.jp2 im_im_jp2_5.tif
$ compare -metric PAE reference_jp2/jp2_5.tif im_im_jp2_5.tif null:
0 (0)
I opened an ImageMagick issue to ask about this: https://github.com/ImageMagick/ImageMagick/issues/409
ImageMagick have confirmed it's a bug in compare
:
We are not detecting the colorspace properly. Some of the images are in the Rec601YCbCr colorspace.... We will apply a patch soon to properly detect the colorspace in JP2 images.
These are the results of converting ISO 15444-4 test images 1, 5, and 7 (because Sipi crashes on the others), and checking peak absolute error (PAE) using ImageMagick's
compare
program with the OpenJPEG library.ImageMagick reports no distortion with image 1. With images 5 and 7, the interesting thing is that we find exactly the same distortion, regardless of whether we convert from TIFF to JP2 or from JP2 to TIFF. And if we do a round-trip conversion, these two distortions seem to cancel each other out, so we get back the original, undistorted image.
You can run these by typing
make check
on thewip/jp2-conformance-testing
branch. It requires an installation of ImageMagick with OpenJPEG built in.