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 "JPEG-2000 Lossy"? #774

Open
Dev-Lan opened this issue Feb 20, 2024 · 1 comment
Open

Support for "JPEG-2000 Lossy"? #774

Dev-Lan opened this issue Feb 20, 2024 · 1 comment

Comments

@Dev-Lan
Copy link

Dev-Lan commented Feb 20, 2024

User story
Ome-tiff supports lossy JPEG-2000 compression. On my particular dataset I converted it with bftools -compression set to JPEG-2000 Lossy. This reduced my image file from around 1mb each to 250kb. This reduction has positive performance implications for a web application that is fetching this data. The lossy compression may be an acceptable tradeoff in some cases for smaller file sizes.

I am currently using loadOmeTiff to load my files; however this does not appear to support JPEG-2000 Lossy.

Preferred solution
If loadOmeTiff supported JPEG-2000 Lossy and could decode it quickly it would give a more performant option for applications that fetch a lot of images.

Possible alternatives
I tried all the compression supported by bfconvert:

  • zlib: This is potentially the next best option. My files were reduced from 1mb to 850kb. zlib seems to have an optimization option, but not sure if there's a way to select this with bfconvert.
  • LZW: files were larger
  • JPEG: did not work for my files
  • JPEG-2000: My files were reduced from 1mb to 900kb.
  • JPEG-2000 Lossy: My files were reduced from 1mb to 250kb.

Open to any other suggestions for reducing file size. The resolution of the files are not large. These are 767x767 pixels with a single channel of data. 1MB seems like could be reduced, especially if lossy compression is acceptable.

@ilan-gold
Copy link
Collaborator

@Dev-Lan If you could compile a JPEG2000 compressor to wasm (written in e.g., C), you could use it by registering it as a codec. See here for an example of how we set up the class for this for lzw. You can then register the codec with geotiff according to the integer number in the tiff file for that compression algorithm (for LZW, for example, it is 5).

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

No branches or pull requests

2 participants