mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +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:
|
if im_frames:
|
||||||
# delta frame
|
# delta frame
|
||||||
previous = im_frames[-1]
|
previous = im_frames[-1]
|
||||||
if "disposal" in encoderinfo and encoderinfo["disposal"] == 2:
|
if encoderinfo["disposal"] == 2:
|
||||||
# If diposing whole frame, treat full new frame as delta
|
# Entire frame should be delta
|
||||||
delta = im_frame
|
# 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) == \
|
elif _get_palette_bytes(im_frame) == \
|
||||||
_get_palette_bytes(previous['im']):
|
_get_palette_bytes(previous['im']):
|
||||||
delta = ImageChops.subtract_modulo(im_frame,
|
delta = ImageChops.subtract_modulo(im_frame,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user