Replies: 6 comments
-
Hello @gil-c, you'd need to ask libtiff to implement jp2k compression, then once that's working, libvips could try to add support. But I doubt if they are interested -- jp2k is not a very competitive image compression standard. |
Beta Was this translation helpful? Give feedback.
-
Hello @jcupitt, ok thanks. |
Beta Was this translation helpful? Give feedback.
-
The only not-terrible open source jp2k compression / decompression library is openjpeg, but it's still slow, unfortunately. Companies like Aperio pay a lot of money to build fast jp2k compress and decompress into their products. If libtiff were to add jp2k support, they could only use openjpeg, and it would be much slower than commercial offerings. openslide does this and performance is not great. As well as being very slow, jp2k offers only about 30% better compression than regular jpeg, so you can achieve the same ratio with mozjpeg, or with webp (which libtiff supports). The future belongs to codecs like h265 and av1 which are at least 2x better than jpeg at compressing and have widely-available hardware support. I didn't know jp2k has 16-bit, that's good. HEIC has 16-bit support too, though I think the readers don't all have it yet. I don't know if AV1 supports 16 bit. |
Beta Was this translation helpful? Give feedback.
-
Apparently they improved openjpeg in 2017: https://www.openjpeg.org/2017/04/27/Faster-OpenJPEG-is-on-track |
Beta Was this translation helpful? Give feedback.
-
I don't understand this answer: "We've done that with libtiff and OpenJPEG for a number of years, just simply use them separately." from the link here above. Do you understand what it means? Edit: I got it, it means passing/retreiving the tiles already encoded to/from libtiff with TIFFWriteRawTile()/TIFFReadRawTile() http://www.simplesystems.org/libtiff/man/TIFFWriteRawTile.3tiff.html But I guess this would probably require significant changes to LibVips.. |
Beta Was this translation helpful? Give feedback.
-
Yes, I think that's what openslide does (it is able to read jp2k-encoded tiff). Someone would need to implement the opposite direction (encode, not decode). |
Beta Was this translation helpful? Give feedback.
-
Hi,
I saw here: #79 (comment) that libtiff does not support jp2k compression out of the box, and thus it is not an option when using tiffsave.
Is there any update on this?
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions