mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Disposal method 2 is transparency or black when saving
This commit is contained in:
parent
6db0e96102
commit
461628845d
|
@ -461,10 +461,10 @@ def _write_multiple_frames(im, fp, palette):
|
||||||
previous = im_frames[-1]
|
previous = im_frames[-1]
|
||||||
if encoderinfo.get("disposal") == 2:
|
if encoderinfo.get("disposal") == 2:
|
||||||
if background_im is None:
|
if background_im is None:
|
||||||
background = _get_background(
|
color = im.encoderinfo.get(
|
||||||
im,
|
"transparency", im.info.get("transparency", (0, 0, 0))
|
||||||
im.encoderinfo.get("background", im.info.get("background")),
|
|
||||||
)
|
)
|
||||||
|
background = _get_background(im_frame, color)
|
||||||
background_im = Image.new("P", im_frame.size, background)
|
background_im = Image.new("P", im_frame.size, background)
|
||||||
background_im.putpalette(im_frames[0]["im"].palette)
|
background_im.putpalette(im_frames[0]["im"].palette)
|
||||||
base_im = background_im
|
base_im = background_im
|
||||||
|
|
Loading…
Reference in New Issue
Block a user