mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-22 13:14:45 +03:00
GIF: Clear to transparency rather than background if available.
Background dispose should prefer the transparency color over the background color, if there is one. This matches other decoders and makes transparent_dispose.gif decode correctly.
This commit is contained in:
parent
df10a72000
commit
b5806c7e15
|
@ -258,9 +258,10 @@ class GifImageFile(ImageFile.ImageFile):
|
||||||
# do not dispose or none specified
|
# do not dispose or none specified
|
||||||
self.dispose = None
|
self.dispose = None
|
||||||
elif self.disposal_method == 2:
|
elif self.disposal_method == 2:
|
||||||
# replace with background colour
|
# replace with transparency if there is one, otherwise
|
||||||
self.dispose = Image.core.fill("P", self.size,
|
# background colour
|
||||||
self.info["background"])
|
bg = info.get("transparency", self.info["background"])
|
||||||
|
self.dispose = Image.core.fill("P", self.size, bg)
|
||||||
else:
|
else:
|
||||||
# replace with previous contents
|
# replace with previous contents
|
||||||
if self.im:
|
if self.im:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user