Skip to content

Commit c0bc9dc

Browse files
Handle palette images with translucency (#7)
* Handle palette images with translucency Images with transparency stored in the palette format were assumed opaque * Reformat
1 parent 877dd12 commit c0bc9dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/amulet/resource_pack/java/resource_pack_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ def _load(self, progress_manager: AbstractProgressManager) -> None:
151151
if im.mode == "RGBA":
152152
alpha = numpy.array(im.getchannel("A").getdata())
153153
texture_is_transparent = bool(numpy.any(alpha != 255))
154+
elif im.mode == "P":
155+
texture_is_transparent = (
156+
im.info.get("transparency", 0) != 0
157+
)
154158
else:
155159
texture_is_transparent = False
156160

0 commit comments

Comments
 (0)