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

Wishlist: support for zlib compression in Tiff files #241

Open
ajasja opened this issue May 6, 2022 · 2 comments
Open

Wishlist: support for zlib compression in Tiff files #241

ajasja opened this issue May 6, 2022 · 2 comments

Comments

@ajasja
Copy link
Contributor

ajasja commented May 6, 2022

  • Picasso version: 0.4
  • Python version: 3.8.5
  • Operating System: Win10

Description

Trying to load a tiff with zlib compression. In my particular case there is a huge size difference between compressed and uncompressed.
image

What I Did

The file was written with and can be opened in imageJ.

tifffile.imwrite('test.zlib.ome.tif', out , ome=True, dtype=np.uint8, 
    photometric='minisblack', metadata={'axes': 'TYX'}, compression='zlib')

Tifffile (https://github.com/cgohlke/tifffile) could be used to load the tiff file.

Example image (no compression):
image

Example image of compressed file:
image

@ajasja ajasja changed the title Wish: support for zlib compression in Tiff files Wishlist: support for zlib compression in Tiff files May 6, 2022
@rafalkowalewski1
Copy link
Collaborator

Hi Ajasja,
I took a close look at the issue you reported and here are some of my conclusions:

  • I am not sure if you let zlib compression for a long enough time. I also observed that immediately after calling tifffile.imwrite a new file was created of a very small size but the function did not finish running. After a few seconds/minutes, the compressed file was updated and the different in sizes of the compressed and uncompressed files was no longer so drastic. However, I tried compressing a tiff file of size around 4GB so this may not apply in your case.
  • Unfortunately, after the compression was finished, I also saw the noisy image you posted above. I will try to take a closer look at compressing image files and to include reading them in Localize.

@ajasja
Copy link
Contributor Author

ajasja commented Jun 16, 2022

Thanks! @rafalkowalewski1 . In my case I think the difference in size is due to most of the image being set to 0, so it's easy to compress. It is of curse also possible that I did not wait long enough for the size to update.

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