From 4ee1e0ea6bd268ca1c9a9cacebef6e5ee06fa8fe Mon Sep 17 00:00:00 2001 From: Pablo Speciale Date: Thu, 29 Feb 2024 15:05:30 +0100 Subject: [PATCH] Compress depth maps --- scantools/utils/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scantools/utils/io.py b/scantools/utils/io.py index 59fc55e..cc11291 100644 --- a/scantools/utils/io.py +++ b/scantools/utils/io.py @@ -64,7 +64,7 @@ def write_depth(path: Path, depth: np.ndarray): mask = (depth > np.iinfo(dtype).max) | (depth < 0) depth[mask] = 0 # avoid overflow im = PIL.Image.fromarray(depth.round().astype(dtype)) - im.save(path) + im.save(path, format='PNG', compress_level=9) try: