Skip to content

Commit 2dc691b

Browse files
committed
Fix decoding RGBA-5551
1 parent 3afd881 commit 2dc691b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

file-mat/mat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def _decode_pixel(p, ci): # p: int, ci: color_format
246246
# Return pixel representation
247247
if ci.alpha_bpp != 0:
248248
a = ((p >> ci.alpha_shl) & MAT._get_color_mask(ci.alpha_bpp)) << ci.alpha_shr
249+
if ci.alpha_bpp == 1: # RGBA5551
250+
a = 255 if a > 0 else 0
249251
p = (int(r), int(g), int(b), int(a))
250252
else:
251253
p = (int(r), int(g), int(b))

0 commit comments

Comments
 (0)