Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping frames in animated GIF and PNG #5032

Closed
doublex opened this issue Nov 5, 2020 · 13 comments
Closed

Overlapping frames in animated GIF and PNG #5032

doublex opened this issue Nov 5, 2020 · 13 comments
Labels

Comments

@doublex
Copy link

doublex commented Nov 5, 2020

This image:
AnimGif

Testcase (frame is interleaved - tested with PIL7 and PIL8):

import PIL.Image
imageObject = PIL.Image.open("/tmp/98246874-2e18a800-1f73-11eb-8583-f2c1f7d293f0.gif")
imageObject.seek(5)
imageObject.seek(6)
imageObject.seek(7)
imageObject.show() 
@radarhere radarhere added the GIF label Nov 5, 2020
@doublex
Copy link
Author

doublex commented Nov 6, 2020

Expected result:
test-7

PIL frame:
7

@doublex
Copy link
Author

doublex commented Nov 6, 2020

Also APNG images won't load properly:
ezgif-3-74c50ea21b65

@radarhere radarhere changed the title AnimGIF shows wrong frame Overlapping frames in animated GIF and PNG Nov 6, 2020
@radarhere
Copy link
Member

For the record, the animated PNG you have just attached shows this when the code from your first post is run.

png

@doublex
Copy link
Author

doublex commented Nov 6, 2020

Yes, there are bugs decoding AnimGIFs and APNGs (GIF is nastier).
imagemagick decodes the frame to:
xx-7

@stevemcgf
Copy link

I only see the issue with APNG files not with GIF.

@stevemcgf
Copy link

stevemcgf commented Nov 30, 2020

Animated PNG
sticker02

Incorrect render of 2nd frame
tmpmvjf3dp4

Fixed render of 2nd frame (using code in pull request)
tmp1l63_0g8

@doublex
Copy link
Author

doublex commented Nov 30, 2020

@stevemcgf

AnimGIF renders wrong (at least for me using pillow 8.0.1).
Steps to reproduce:

wget https://user-images.githubusercontent.com/274624/98246874-2e18a800-1f73-11eb-8583-f2c1f7d293f0.gif
import PIL.Image
image = PIL.Image.open("/tmp/98246874-2e18a800-1f73-11eb-8583-f2c1f7d293f0.gif")
for frame in PIL.ImageSequence.Iterator(image):
    last_frame = frame
last_frame.show()

@radarhere
Copy link
Member

The GIF part of this should be resolved by #5125

@radarhere
Copy link
Member

I've created PR #5126 to resolve the APNG part of this, as an alternative to #5071

@radarhere
Copy link
Member

The GIF part of this should be fixed in Pillow 8.1.0, due to be released on January 2.

@doublex
Copy link
Author

doublex commented Dec 29, 2020

Thanks for the effort!

@doublex doublex closed this as completed Dec 29, 2020
@radarhere
Copy link
Member

The APNG part of this should now also be fixed in Pillow 8.1.0

@doublex
Copy link
Author

doublex commented Dec 31, 2020

@radarhere
Thanks again for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants