-
Notifications
You must be signed in to change notification settings - Fork 106
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
Apply run length encoding while saving masks. #291
Comments
That's actually redundant (changing to PILLOW) IMO. Also, a uniformly random binary PNG mask (2048x2048) saved with default compress level (9) but without RLE is roughly 800KB, and 500KB with RLE. In case of non-random binary mask with large consecutive white regions, the size difference will be much smaller. So my two cents is that, if you want to, you can introduce RLE by adding signatures to existing skimage.io/imageio function rather than using PILLOW. |
Hi @CielAl and @jacksonjacobs1 . I tested both methods. The |
Hi @nanli-emory and @jacksonjacobs1 That's probably the difference of signatures: both should specify "optimize". Note that skimage.io by default calls imageio's methods, and imageio by default call's PILLOW's writer itself (see Hence, since we already utilize the skimage.io interface in all modules, which in fact uses the PILLOW's writer, it won't make sense to change the interfaces when skimage.io can achieves the same thing. Here are my test cases and the difference is neglectable: |
Agree with @CielAl that we should keep the skimage interface. If adding RLE helps and is not significantly more CPU intensive, I think it's an easy win? |
Indeed an easy win, especially if you intend to make HistoQC a feasible option for 10k slides, since RLE significantly reduce the storage overhead for binary masks (perhaps 30%+). We can simply update the current |
Hi @jacksonjacobs1 and @CielAl, please review the PR. Thanks. |
The text was updated successfully, but these errors were encountered: