Merge pull request #6798 from radarhere/apply_transparency

This commit is contained in:
Hugo van Kemenade 2022-12-28 16:49:59 +02:00 committed by GitHub
commit 1a93e84355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1531,7 +1531,8 @@ class Image:
def apply_transparency(self):
"""
If a P mode image has a "transparency" key in the info dictionary,
remove the key and apply the transparency to the palette instead.
remove the key and instead apply the transparency to the palette.
Otherwise, the image is unchanged.
"""
if self.mode != "P" or "transparency" not in self.info:
return