Closed william-silversmith closed 2 years ago
To be clear you are proposing adding support to the precomputed format?
Yes. Apologies for the imprecision.
Yes, I'd be happy to take a pull request for that. There is some question as to the best PNG library to use for Neuroglancer --- possibly a webassembly one is the way to go.
Thanks Jeremy! I'm in agreement on using a WASM library. Anything else will probably result in complaints of slowness.
Resolved in #370 Thanks!
Hi Jeremy,
I as looking into methods for decreasing the data usage of raw microscopy that is coming off the scope. For understandable reasons, microscopic are very hesitant to employ any form of lossy compression for these images (though my colleague isn't worried about uint8 representation).
I was evaluating lossless jpeg, png, and gzip and I found that on a few samples PNG had superior compression. The lossless jpeg compressor is pretty similar to the png compressor which is just gzip + some predictive coding. The PNG codecs are much more popular and well supported.
Here's an example image that I downloaded from Neuroglancer as raw and converted to the lossless and uncompressed ppm format.
em.ppm is a section of brain tissue collected under TEM at 4x4x40 resolution. I attempted this with a section of FlyWire data (256x256x128, 8x8x40nm) as well and had similar results.
Would you be open to including png as a decoder in Neuroglancer? A ~25% lossless reduction in storage for raw images seems pretty enticing. I haven't timed it, but I suspect the higher compression may result in a faster decode time too since I doubt inverting the predictive coding pass is at all a bottleneck (it's probably the deflate part).
I would be willing to make a PR (though not sure of the exact time when I can do so).
Thanks Jeremy!