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

Decoding TIFF very slow #580

Open
jonaskohl opened this issue Dec 1, 2021 · 5 comments
Open

Decoding TIFF very slow #580

jonaskohl opened this issue Dec 1, 2021 · 5 comments

Comments

@jonaskohl
Copy link

I'm using image-js to decode multipage TIFF images. However, the performance is really poor. I have a 32 page TIFF for example, which takes almost 2 minutes to decode in Chrome on a decent machine. I'm using Image.load(tiffBytes) to decode the image. Is there any chance I could speed up the decoding time as this is almost unbearable for the end user?

@jonaskohl
Copy link
Author

Okay, this is probably because the uncompressed version of this TIFF is over 1 GiB

@lpatiny
Copy link
Member

lpatiny commented Dec 2, 2021

Did you try to load the uncompressed image ? I'm able to load uncompressed tiff of 1.5Gb in just couple of seconds.

In tiff the compression could be Zip or LZW. This can be checked using the command (from ImageMagick):

identify -format "%[compression]\n" *

You may open an issue with an image example in the project https://github.com/image-js/tiff. You may also open a PR if you see how to improve performances.

@jonaskohl
Copy link
Author

Yes, I tried that and got similarly poor performance

I will open an issue there

@jonaskohl
Copy link
Author

I created the issue in image-js/tiff#41

@jonaskohl
Copy link
Author

I also noticed that Image.getRGBAData() is quite slow (~ 80ms per page for the image I'm using)

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