n5-blosc

March 3, 2026 ยท View on GitHub

Build Status

Build Status

n5-blosc

Blosc compression for N5.

This library wraps the JBlosc interface for C-Blosc as an N5 compression interface. JBlosc depends on libblosc1. On Ubuntu 18.04 or later, install with:

sudo apt-get install -y libblosc1

On other platforms, please check the installation instructions for JBlosc.

Build and install:

mvn clean install

json serialization

N5's blosc compression is serialized with a json object with

Required name:

  • "type" must have value "blosc"

Optional names:

  • "clevel" (Default : 6)
  • "blocksize" (Default : 0 = auto)
  • "cname" (Default: "blosclz")
    • One of ["blosclz", "lz4", "lz4hc", "zlib", "zstd"], see here
  • "nthreads" (Default: 1)
  • "shuffle" (Default: 0)
    • 0 = NOSHUFFLE
    • 1 = SHUFFLE
    • 2 = BITSHUFFLE

Example

{
  "compression": {
    "type": "blosc",
    "clevel": 6,
    "blocksize": 0,
    "cname": "blosclz",
    "nthreads": 1,
    "shuffle": 0
  }
}