cgohlke / imagecodecs

Image transformation, compression, and decompression codecs
https://pypi.org/project/imagecodecs
BSD 3-Clause "New" or "Revised" License
111 stars 21 forks source link

Usage of ZFP compressor #75

Closed Artholgar closed 1 year ago

Artholgar commented 1 year ago

Hi !

I'm trying to use imagecodecs with Zarr to do some lossy compression, but I'm not sure of how to tune Zfp() compressor. With the mode FIXED_RATE I can tune the compressor like this :

compressor = imagecodecs.numcodecs.Zfp(level=1, mode=imagecodecs.ZFP.MODE.FIXED_RATE, header=imagecodecs.ZFP.HEADER.FULL)

but for FIXED_ACCURACY and FIXED_PRECISION the level field doesn't seems to have any impact on the result.

Can you help me with that ?

Thanks :)

cgohlke commented 1 year ago

For fixed accuracy mode, level is the absolute error tolerance. For fixed precision mode, level is the precision, which specifies how many uncompressed bits per value to store.