8000 fix addalpha with scrgb images · libvips/pyvips@3c92762 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c92762

Browse files
committed
fix addalpha with scrgb images
1 parent 3eff2c7 commit 3c92762

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- improve generation of `enums.py`
66
- add `stream.py` example
77
- fix a missing reference issue with custom sources
8+
- fix `addalpha` with scrgb images [RiskoZoSlovenska]
89

910
## Version 2.2.2 (released 4 Jan 2023)
1011

pyvips/vimage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,8 @@ def addalpha(self):
18861886
"""Add an alpha channel."""
18871887
if self.interpretation == 'grey16' or self.interpretation == 'rgb16':
18881888
max_alpha = 65535
1889+
elif self.interpretation == 'scrgb':
1890+
max_alpha = 1.0
18891891
else:
18901892
max_alpha = 255
18911893
return self.bandjoin(max_alpha)

0 commit comments

Comments
 (0)
0