Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for partial decoding of JPEG 2000 and pyramid TIFs #4111

Open
marma opened this issue Oct 2, 2019 · 1 comment
Open

Support for partial decoding of JPEG 2000 and pyramid TIFs #4111

marma opened this issue Oct 2, 2019 · 1 comment

Comments

@marma
Copy link

marma commented Oct 2, 2019

Hi!

I'm using PIL to serve images using the IIIF protocol and have a performance question. Has there been any work done, or interest shown, in partial decoding of JPEG2000-images (and multi-resolution TIFs)?

There are two things that speed up the decompression of an image a lot when using opj_decompress: (1) reducing the size and quality layers and (2) cropping.

This is useful when creating tiles and/or thumbnails on the fly from large image collections, i.e when you don't want to create and save a huge number of pre-scaled/cropped tiles and sizes. As far as I can tell you can set Jpeg2KImageFile.reduce and .layers to decrease the final size which will result in faster decode time, but there is no way to decode only the cropped region. Am I correct, or is there any way to tell PIL to tell OpenJPEG to do partial decoding?

Best regards,
Martin

@radarhere
Copy link
Member

radarhere commented Oct 31, 2024

Regarding multi-resolution / pyramid TIFFs, while #3053 indicates we have some support, this may relate to #1888 - see #1888 (comment)

I'd still recommend using gdal backed (e.g. rasterio) readers/writers for that, as we've got 0 support for pyramids, spatial metadata, and tiled tiffs. It's a huge field, and we're not even at square 1 for it.

So I'm not convinced that we have good support for that type of data, even before talking about partial decoding. An example file might help narrow the focus of this question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants