Skip to content

Compress TIFFs on save#1131

Merged
carsen-stringer merged 1 commit intoMouseLand:mainfrom
qin-yu:compress-tiff
Apr 7, 2025
Merged

Compress TIFFs on save#1131
carsen-stringer merged 1 commit intoMouseLand:mainfrom
qin-yu:compress-tiff

Conversation

@qin-yu
Copy link
Copy Markdown
Contributor

@qin-yu qin-yu commented Mar 19, 2025

Hi @carsen-stringer,

I made this small change because it saves a huge amount of storage in my projects. Segmentations compress really well, e.g. a 3D segmentation of (263 x 1024 x 1024) drops from 526 MB to 2.5 MB when using zlib with tifffile.imwrite(), about a 99.5% reduction.

I think most users saving segmentations with Cellpose would benefit from this, since the main bottleneck is usually I/O, not compression speed.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 52.69%. Comparing base (95e2f60) to head (84e8589).
Report is 45 commits behind head on main.

Files with missing lines Patch % Lines
cellpose/io.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1131      +/-   ##
==========================================
+ Coverage   52.68%   52.69%   +0.01%     
==========================================
  Files          18       18              
  Lines        4328     4342      +14     
==========================================
+ Hits         2280     2288       +8     
- Misses       2048     2054       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@carsen-stringer carsen-stringer merged commit 4b084b2 into MouseLand:main Apr 7, 2025
12 checks passed
@carsen-stringer
Copy link
Copy Markdown
Member

thank you!

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

Successfully merging this pull request may close these issues.

2 participants