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

Animated GIF frames rendered incorrectly #1742

Closed
czablocki opened this issue Feb 24, 2016 · 3 comments · Fixed by #5857
Closed

Animated GIF frames rendered incorrectly #1742

czablocki opened this issue Feb 24, 2016 · 3 comments · Fixed by #5857

Comments

@czablocki
Copy link

czablocki commented Feb 24, 2016

The attached animated .gif (bad.gif) is rendered incorrectly by PIL, with a lot of artifacts and noise in its frames (eg: bad_frame_2.gif). The same file plays correctly in web browsers and image viewers on Windows and Linux.

After uploading and re-downloading bad.gif from imgur.com, I got good.gif, which displays correctly in everything.

good.gif is slightly different in size and has slightly different color tables, but the part I'd expect to be important (transparency index and corresponding palette entry) is the same.

The only remarkable things about bad.gif that I noticed is the transparency index (0) maps to white (255,255,255) and it has NoDispose (1) as its dispose_method

Here's the test script:

from PIL import Image

image = Image.open("good.gif")
#image = Image.open("bad.gif")

#actually 18 frames long
for x in range(0, 2):
    image.seek(x)
    image.show()

bad.gif
bad
bad_frame_2

good.gif
good
good_frame_2

@fionafibration
Copy link

I have a similar issue: Attempting to render the color code rgb(54, 57, 63) leads to gifs that look like this:
image

My code is https://github.com/ThePlasmaRailgun/FinBot/blob/master/astar.py#L167

@aclark4life aclark4life added this to Backlog in Pillow May 11, 2019
@aclark4life aclark4life moved this from Backlog to Icebox in Pillow May 11, 2019
@radarhere
Copy link
Member

@Fiona1729 I'm not quite certain what you're saying. If you'd like us to investigate, please provide a self-contained example.

@radarhere
Copy link
Member

I've created PR #5857 to resolve this.

1

Pillow automation moved this from Icebox to Closed Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Pillow
  
Closed
Development

Successfully merging a pull request may close this issue.

5 participants