-
Notifications
You must be signed in to change notification settings - Fork 52
Compression Choices
CloudVolume has many different codecs to choose from for each compression type. Here is a short guide (to be improved upon) to give some guidance on which one to choose.
Some encodings can be layered with a second stage bitstream compression. We support gzip and brotli (br) mainly because that is what browsers (and hence Neuroglancer) automatically support. It is possible in the future to add support for e.g. zstd but Neuroglancer would have to have a codec for it. Note that brotli is not supported for sharded data currently (Neuroglancer only has a gzip decompression JS module).
Generally grayscale 8 or 16 bit electron or light microscopy images.
Choices: raw, raw+gzip, raw+br, png, jpeg, jxl
- If you can tolerate lossy compression, jpeg will be very fast and gives good compression.
-
jxl(JPEG XL) gives good performance with both lossy and lossless options. It can generally compress about 2x as much as jpeg for similar quality. Lossless compression can be better thanpngand done faster. Results and performance can be tuned withqualityandeffortparameters. Not yet integrated into mainline Neuroglancer. -
pngis slow, but will give better lossless compression by about 25% compared withraw+gzip. -
raw+gzipandraw+brhave slightly different performance profiles but will give similar compression at the default settings. -
rawmeans uncompressed. Very fast on SSD, not so much on remote networks. Untenable for large datasets. -
jpegdoes not support 16-bit images (it technically does, but requires special recompilation of the library so no).
These are usually uint32 or uint64 densely labeled data.
Choices: raw, compressed_segmentation (cseg), compresso, crackle (all +gzip or +br)
-
compressed_segmentationwill generally give the best neuroglancer rendering performance as it's the native representation. Other formats are decoded torawthen reencoded ascompressed_segmentationin the browser. - For smooth segmentation, generally go with
compresso+brfor the best compression ratio and almost top performance.crackle+brgives superior compression and performance tocompresso, but is experimental. - For noisy segmentation, go with
cseg+brfor the best compression and top performance. - If you use crackle, please communicate with Will Silversmith.
compresso, crackle, and cseg are codecs designed for connectomics data. Crackle and compresso are novel high compression codecs.
Intermediate float32 xyz neighbor affinity predictions used for creating segmentation and region graphs. These are very heavy, 12x bigger than the base image. More information: https://github.com/seung-lab/cloud-volume/wiki/Advanced-Topic:-fpzip-and-kempressed-Encodings
Choices: raw, raw+gz, raw+br, fpzip, kempressed
- Use
kempressedfor best compression. - Note that the official Neuroglancer client cannot display
fpziporkempressed, so you'll have to useraw+Xif that's a requirement.
These are usually float32 images with an X and Y component. Some older versions are int16 to which this advice does not apply.
Choices: raw, raw+gzip, raw+br, fpzip, zfpc
- The current best choice is to use
raw+br -
zfpcis an experimental lossy compression choice that will likely be the go-to option in the future. Don't pick it for now unless you are in communication with Will Silversmith
Experimental Codecs: fpzip, kempressed, crackle, and zfpc
These codecs are not integrated into mainline Neuroglancer. However, you can visualize them using a Neuroglancer fork.
- Live Neuroglancer Link: https://allcodecs-dot-neuromancer-seung-import.appspot.com/
- Github Link: https://github.com/william-silversmith/neuroglancer/tree/wms_combined_codecs