diff --git a/CHANGELOG.md b/CHANGELOG.md index 7796dd407..b42238dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.28.1 +### Improvements +- When writing zarr sinks through the converter, use jpeg compression for lossy data ([#1501](../../pull/1501)) + ### Changes - Improve algorithm sweep example options ([#1498](../../pull/1498)) diff --git a/sources/zarr/large_image_source_zarr/__init__.py b/sources/zarr/large_image_source_zarr/__init__.py index fb22d24a0..18f53e68d 100644 --- a/sources/zarr/large_image_source_zarr/__init__.py +++ b/sources/zarr/large_image_source_zarr/__init__.py @@ -819,7 +819,10 @@ def write( from large_image_converter import convert attrs_path = Path(source._tempdir.name) / '.zattrs' - convert(str(attrs_path), path, overwrite=overwriteAllowed) + params = {} + if lossy and self.dtype == np.uint8: + params['compression'] = 'jpeg' + convert(str(attrs_path), path, overwrite=overwriteAllowed, **params) def open(*args, **kwargs):