openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

approxIsValid errors #230

Closed jessicatieman closed 1 week ago

jessicatieman commented 2 weeks ago

I am working with an institution who is converting TIFF images to JPEG2000 using Adobe Photoshop and we are having difficulty determining the root cause for validation errors of the JP2’s using Jpylyzer. Is there a contact OPF that can provide suggestions or insight for issues like this? Thank you

bitsgalore commented 2 weeks ago

Hi @jessicatieman ,

From what you're writing I understand you're using Adobe's JPEG 2000 plugin, is this correct?

If so: that plugin is notoriously rubbish, and the image files it creates have several faults. First of all, it creates images in the JPX (JPEG 2000 Part 2) format, rather than JP2. This format is poorly supported, with the result that other reading applications will often not be able to e.g. interpret colour space information correctly. This is especially problematic if colour space is defined by an ICC profile. See below link for more details:

http://web.archive.org/web/20231209151648/https://wiki.opf-labs.org/display/TR/Handling+of+ICC+profiles

Since these are not JP2 files, validation against JP2 will result in several validation errors, amongst which the "approxIsValid" one (which is related to colour space).

Confusingly format id tools identify these files as "JP2", because the "brand" header field doesn't conform to JPX either. More details on this here:

http://web.archive.org/web/20231209153455/https://wiki.opf-labs.org/display/TR/Files+identified+as+JP2+are+really+JPX

Finally Adobe's implementation also messed up some of the tile-part headers, which can result in incomplete image reads (which can lead to data loss if the images ever need to be migrated to some other format in the future). Details here:

http://web.archive.org/web/20231001094926/https://wiki.opf-labs.org/display/TR/Erroneous+tile-part+information+in+images+created+by+Adobe+Photoshop

So I would strongly recommend to not use the Photoshop plugin for any production work, but use a dedicated JPEG 2000 encoder such as Kakadu.

If you need more help feel free to drop me a line at johan.vanderknijff@kb.nl.

stweil commented 2 weeks ago

So I would strongly recommend to not use the Photoshop plugin for any production work, but use a dedicated JPEG 2000 encoder such as Kakadu.

Kakadu is a good choice. If you are looking for a free solution, grok and OpenJPEG are possible alternatives.

bitsgalore commented 2 weeks ago

@stweil Yes I should have mentioned that. Worth mentioning though that last time I checked (this was two years ago) OpenJPEG's support of ICC profiles was limited, and it also doesn't read/write resolution boxes. More info in this 2022 post (which also covers Grok, which looks like a realy good choice these days):

https://www.bitsgalore.org/2022/03/30/generating-lossy-access-jp2s-from-lossless-preservation-masters

stweil commented 2 weeks ago

I'm afraid this is still a deficit of OpenJPEG.