Earth Compress benchmark

Codecs

The tables group the configurations the benchmark can run by fidelity mode. Each results.csv shows which configurations have been measured. PROTOCOL.md defines the fidelity checks. TOLERANCE.md defines the error budgets.

Lossless

id group definition software
zstd-c3 Array stores Zstandard level 3 over the raw bytes python-zstandard
blosc-zstd3-bitshuffle Array stores Blosc with Zstandard level 3 and bit shuffle, the setting of the EOPF Sentinel Zarr products numcodecs (c-blosc)
pco Array stores Pcodec level 8 over the flattened array, a lossless codec for numerical sequences imagecodecs (pcodec 1.0.4)
deflate-c6 Raster files DEFLATE level 6 over the raw bytes Python zlib
lzw Raster files LZW over the raw bytes, as in a TIFF written with LZW and no predictor imagecodecs
hdiff-zstd9 Raster files Horizontal differencing as TIFF PREDICTOR=2, then Zstandard level 9 as GDAL writes a ZSTD GeoTIFF NumPy and python-zstandard
openzl-generic OpenZL compress_generic at level 7 openzl 0.3.0
openzl-delta-fieldlz OpenZL delta>field_lz openzl 0.3.0
openzl-delta-pivco OpenZL delta>zigzag>transpose>huffman_pivco openzl 0.3.0
geozl-planar-pfor GeoZL planar>zigzag>pfor geozl 0.31.0 on openzl 0.3.0
geozl-planar-pivco GeoZL planar>zigzag>transpose>pivco geozl 0.31.0 on openzl 0.3.0
geozl-med-pivco GeoZL med>zigzag>transpose>pivco geozl 0.31.0 on openzl 0.3.0
geozl-planar-entropy GeoZL planar>zigzag>transpose>entropy geozl 0.31.0 on openzl 0.3.0
geozl-med-entropy GeoZL med>zigzag>transpose>entropy geozl 0.31.0 on openzl 0.3.0
geozl-average-entropy GeoZL average>zigzag>transpose>entropy geozl 0.31.0 on openzl 0.3.0
geozl-id-pfor GeoZL id>pfor geozl 0.31.0 on openzl 0.3.0
jpeg2000 Reference JPEG 2000 lossless with the reversible 5/3 wavelet, bands as components imagecodecs (OpenJPEG 2.5.4)

jpeg2000 is a separate reference. It is measured only when requested and only on integer corpora of up to 16 bits.

Near-lossless

Near-lossless and lossy ids end with the budget level, as in lerc-matched. The tables show base ids before that suffix is added. The family column shows how each configuration uses tau. native uses the codec's error or quality setting. quantized uses the shared quantiser. safeguarded adds corrections. searched tries settings on each sample. An empty NoData cell means no mask or sentinel is passed to the codec.

id family definition NoData software
geozl-med-entropy-linear native GeoZL med>zigzag>transpose>entropy with its LINEAR quantiser, tau as error nodata geozl 0.31.0 on openzl 0.3.0
geozl-planar-pfor-linear native GeoZL planar>zigzag>pfor with its LINEAR quantiser, tau as error nodata geozl 0.31.0 on openzl 0.3.0
geozl-planar-pivco-linear native GeoZL planar>zigzag>transpose>pivco with its LINEAR quantiser, tau as error nodata geozl 0.31.0 on openzl 0.3.0
lerc native LERC with tau as maxZError, as GDAL writes it valid mask imagecodecs (LERC 4.2.0)
jpegls-near native JPEG-LS with tau as NEAR, one stream per plane imagecodecs (CharLS 2.4.4)
sz3-abs native SZ3 with tau as its absolute bound imagecodecs (SZ3 3.4.0)
zfp-accuracy native ZFP in fixed-accuracy mode, tau as the tolerance imagecodecs (zfp 1.0.1)
sperr-pwe native SPERR in point-wise error mode imagecodecs (SPERR 0.8.5)
quant-<id> quantized The quantiser, then the lossless configuration <id> bottom of the type that of <id>
sg-<id> safeguarded The native configuration <id> inside Compression Safeguards kept compression-safeguards 1.0.0rc5 and numcodecs-safeguards 0.1.0rc5
sg-zero safeguarded Compression Safeguards around a codec that decodes to zeros kept compression-safeguards 1.0.0rc5 and numcodecs-safeguards 0.1.0rc5

The quantiser can feed zstd-c3, pco, blosc-zstd3-bitshuffle, hdiff-zstd9, openzl-generic or geozl-med-entropy.

Lossy

id family definition NoData software
jpeg2000-psnr native JPEG 2000 with the irreversible 9/7 wavelet and no colour transform, at the PSNR whose root-mean-square error is tau imagecodecs (OpenJPEG 2.5.4)
sperr-psnr native SPERR in PSNR mode, at the PSNR whose root-mean-square error is tau imagecodecs (SPERR 0.8.5)
sz3-l2norm native SZ3 in its L2-norm mode imagecodecs (SZ3 3.4.0)
jpegxl-distance searched JPEG XL at effort 7, one grayscale frame per plane, the distance searched imagecodecs (libjxl 0.12.0)
quant-pco-rms quantized The quantiser with its lossy grid, then pco bottom of the type imagecodecs (pcodec 1.0.4)

LERC, JPEG-LS, ZFP and GeoZL have no separate lossy configuration. A near-lossless row that meets its pointwise bound also meets the lossy bound at the same tau.

The quantiser

The quantiser rounds values to a grid. It passes the grid indices to an unchanged lossless configuration in the narrowest unsigned type that holds them. Quantised rows keep every promise by construction. Rows in the same mode differ only in their lossless stage.

Integer grids are 2k + 1 codes wide in each plane. They are anchored at the code of a native zero, so zeros stay exact. Near-lossless takes k = floor(tau / scale). Lossy starts from the largest k with k (k + 1) / 3 <= (tau / scale)². At that width, a uniform rounding error has a root-mean-square of tau. SZ3 uses the same rule for its L2-norm mode. A sentinel at the bottom of the type keeps index 0 to itself. Valid values decode above it.

Floats round to multiples of 2 tau in near-lossless mode and 2 sqrt(3) tau in lossy mode. Zero stays exact. Values that element-type rounding would move past the bound are kept exactly beside the grid, as are nonfinite values.

In lossy mode, a sample whose error is still above tau gets a narrower grid until it is not, and the width is stored with the data. ClimateBenchPress found rounding followed by PCO a reliable baseline (Reichelt et al., 2026), so pco is the lossless stage in lossy mode.

Compression Safeguards

sg-<id> wraps a native near-lossless configuration in Compression Safeguards (Tyree et al., 2026). It sets an absolute bound of tau, keeps the sentinel in its original positions and keeps exact zeros. During encoding, the safeguards decode the native output and store corrections that restore every promise. Decoding applies those corrections. The native codec runs unchanged. The difference from its own row shows the cost of the safeguards. In sg-zero, every value comes from the corrections.

Settings

Notes by codec

Adding a configuration

Add a module to earthcompress/codecs/. Define CONFIGURATIONS for lossless configurations, FAMILIES for a native near-lossless codec, or LOSSY for a lossy one. A configuration uses a sample's ArraySpec to build an object with encode and decode. A family maps a budget to a configuration. Create it with near_lossless or lossy in earthcompress/codecs/base.py. Every native near-lossless family also gets a safeguarded variant.

import mycodec

from ..spec import ArraySpec
from .base import lossless, unpack


class MyCodec:
    def __init__(self, spec: ArraySpec):
        self.spec = spec

    def encode(self, array):
        return mycodec.compress(array.tobytes())

    def decode(self, data):
        return unpack(mycodec.decompress(data), self.spec)


CONFIGURATIONS = (lossless("mycodec", "mycodec", mycodec.__version__, MyCodec),)
uv run earthcompress corpora/s2-l1c-10m-4 --codec mycodec

References