From 71d9ce5c5c5787d113b9bc3f3f9f88d164ec297b Mon Sep 17 00:00:00 2001 From: Jakub Both Date: Mon, 24 Jun 2024 10:23:11 +0200 Subject: [PATCH] MAINT: For increased robustness, change the data type via darsia --- src/darsia/image/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/darsia/image/image.py b/src/darsia/image/image.py index de8f812e..dface5b4 100644 --- a/src/darsia/image/image.py +++ b/src/darsia/image/image.py @@ -1627,7 +1627,7 @@ def write(self, path: Path, **kwargs) -> None: """ # Write image, using the conventional matrix indexing - ubyte_image = skimage.img_as_ubyte(self.img) + ubyte_image = self.img_as(np.uint8).img suffix = Path(path).suffix.lower() if suffix in [".jpg", ".jpeg"]: @@ -1742,7 +1742,7 @@ def write(self, path: Path, **kwargs) -> None: # Write image, using the conventional matrix indexing if self.original_dtype == np.uint8: - ubyte_image = skimage.img_as_ubyte(bgr_array) + ubyte_image = bgr_image.img_as(np.uint8).img suffix = Path(path).suffix.lower() if suffix in [".jpg", ".jpeg"]: