diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8861fc2..aca788b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ - improve generation of `enums.py` - add `stream.py` example - fix a missing reference issue with custom sources +- fix `addalpha` with scrgb images [RiskoZoSlovenska] ## Version 2.2.2 (released 4 Jan 2023) diff --git a/pyvips/vimage.py b/pyvips/vimage.py index 1703ee7..4bef17f 100644 --- a/pyvips/vimage.py +++ b/pyvips/vimage.py @@ -1886,6 +1886,8 @@ def addalpha(self): """Add an alpha channel.""" if self.interpretation == 'grey16' or self.interpretation == 'rgb16': max_alpha = 65535 + elif self.interpretation == 'scrgb': + max_alpha = 1.0 else: max_alpha = 255 return self.bandjoin(max_alpha)