This commit is contained in:
Andrew Murray 2025-04-19 10:12:49 +10:00 committed by GitHub
commit ea9b9e3baf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -445,9 +445,9 @@ def _save(
image = stride * im.size[1]
if im.mode == "1":
palette = b"".join(o8(i) * 4 for i in (0, 255))
palette = b"".join(o8(i) * 3 + b"\x00" for i in (0, 255))
elif im.mode == "L":
palette = b"".join(o8(i) * 4 for i in range(256))
palette = b"".join(o8(i) * 3 + b"\x00" for i in range(256))
elif im.mode == "P":
palette = im.im.getpalette("RGB", "BGRX")
colors = len(palette) // 4