diff --git a/src/PIL/Image.py b/src/PIL/Image.py index d0d5c18846c..842e5db56ea 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1544,7 +1544,7 @@ def has_transparency_data(self) -> bool: """ return ( self.mode in ("LA", "La", "PA", "RGBA", "RGBa") - or (self.mode == "P" and self.palette.mode == "RGBA") + or (self.mode == "P" and self.palette.mode.endswith("A")) or "transparency" in self.info )