uclouvain / openjpeg

Official repository of the OpenJPEG project
Other
970 stars 455 forks source link

file9.jp2 is broken with reduction #334

Open gcode-importer opened 10 years ago

gcode-importer commented 10 years ago

Originally reported on Google Code with ID 334

The attached file has been created with

  opj_decompress -i file9.jp2 -o file9-r2.png -r 2

file9.jp2 has 5 reductions (1-5). All are broken.

winfried

Reported by szukw000 on 2014-04-07 22:36:40


gcode-importer commented 10 years ago

Reported by malaterre on 2014-04-28 07:46:46

rouault commented 7 years ago

For reference, "kdu_expand -i ../data/input/conformance/file9.jp2 -o out2.tif -reduce 2" gives exactly the same result as openjpeg. This is inherent to the use of a color table for an image: you need to decode all quality layers and all resolution layers (and the compression must be reversible), otherwise you'll get index values that can point to a completely different R,G,B triplet.