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
Error converting APNG to WEBP #7015
Comments
thanks for the quick reply @radarhere! Looking forward to seeing those changes merged in! 😄 |
Oh, actually, if you want an immediate way to fix the error, you could just insert from PIL import Image
# walking man apng
img = Image.open('img/man.png')
print(img.format)
print(img.mode)
print(img.get_format_mimetype())
print(img.info)
img.info["duration"] = round(img.info["duration"])
img.save('transformed/man.webp', save_all=True)
# beach ball apng
img2 = Image.open('img/beach_ball.png')
print(img2.format)
print(img2.mode)
print(img2.get_format_mimetype())
print(img2.info)
img2.info["duration"] = round(img2.info["duration"])
img2.save('transformed/beach_ball.webp', save_all=True) |
Thanks @radarhere, that's a clever workaround! This is probably a separate issue, but the I started reading through #5755 and #5837, maybe this is a color palette issue? |
I created PR #7018 to fix that part, applying transparency to the new frame before blending it with the current image. |
Just tested this, and it works perfectly! Thanks for the quick fix again! Will this be included in Pillow 9.5.0? |
Yes, #7018 has been merged and will be in 9.5.0 on 1st April 2023. Thanks for the report. |
Pillow 9.5.0 has now been released. |
What did you do?
Opened an animated png file and tried saving it as a webp image.
I tried two animated png's:
What did you expect to happen?
I expected the webp versions to successfully save the animations for both images.
What actually happened?
Error from
WebPImagePlugin.py
on save:What are your OS, Python and Pillow versions?
The output:
The text was updated successfully, but these errors were encountered: