Skip to content

Commit

Permalink
MAINT: For increased robustness, change the data type via darsia
Browse files Browse the repository at this point in the history
  • Loading branch information
jwboth committed Jun 24, 2024
1 parent 676034e commit 71d9ce5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/darsia/image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down Expand Up @@ -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"]:
Expand Down

0 comments on commit 71d9ce5

Please sign in to comment.