mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 12:17:14 +03:00
Create gif frame delta by subtracting 0x0 image if disposal is mode 2
This commit is contained in:
parent
1f6d1be7fc
commit
4a2be2af2d
|
@ -443,9 +443,11 @@ def _write_multiple_frames(im, fp, palette):
|
|||
if im_frames:
|
||||
# delta frame
|
||||
previous = im_frames[-1]
|
||||
if "disposal" in encoderinfo and encoderinfo["disposal"] == 2:
|
||||
# If diposing whole frame, treat full new frame as delta
|
||||
delta = im_frame
|
||||
if encoderinfo["disposal"] == 2:
|
||||
# Entire frame should be delta
|
||||
# Create delta by subtracting empty image from frame (This is required)
|
||||
delta = ImageChops.subtract_modulo(
|
||||
im_frame, Image.new('P', (0,0)))
|
||||
elif _get_palette_bytes(im_frame) == \
|
||||
_get_palette_bytes(previous['im']):
|
||||
delta = ImageChops.subtract_modulo(im_frame,
|
||||
|
|
Loading…
Reference in New Issue
Block a user