-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Read and write some gifs wrong, with "artifacts". "optimize" doesn't work #2543
Copy link
Copy link
Closed
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.GIF
Description
What did you do?
I read each frame of the gif, and then write them to a file.
What did you expect to happen?
That everything will work without a headache =)
What actually happened?
Some gif files wrote with artifacts and "optimize" doesn't work
pic2.gif
I think compare successful and unsuccessful gifs will be right. Therefore I downloaded the gifs archive
"Bad" and "good" gifs tar archive
What versions of Pillow and Python are you using?
Pillow-4.1.1-cp35-cp35m-manylinux1_x86_64.whl
Python 3.5.2
Ubuntu 16.04.2 amd64
from PIL import Image, ImageChops, ImageSequence
f = Image.open('file.gif')
frames = []
framesIterator = ImageSequence.Iterator(f)
for frame in [ frame.copy() for frame in framesIterator ]: frames.append(frame)
frame.save('out.gif', save_all=True, optimize=True, append_images=frames)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.GIF

