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
Converting animated gif to webp produces faulty images #4313
Comments
I'm unable to replicate 2. The following code works for me with your attached images. from PIL import Image
Image.open("animated.webp").show()
Image.open("paris_metro.webp").show() For the record, 3 isn't a problem with WEBP, it's a problem with Pillow loading the GIF. |
To fix 1, you just need to pass in the duration - im = Image.open(src_f)
im.save(dst_f, 'webp', **quali, duration=im.info["duration"], save_all=True) |
OK. Lets see.
Problem 1. is solvable with the mentioned workaround but i consider this now even more a bug as before. Pillow has the input file and can get all needed infos by himself. Or whats next? Do you find it a acceptable approach if i would make a enhancement issue out of it? Chances? So basically pillow takes the duration in the above fashion, if not passed in by user. And thanks for taking the time. |
1 - Pillow values backwards compatibility. So I don't think that changing defaults is likely to be accepted. |
For 3) Ah no, thats good. The explanation is appreciated. Even if i cannot do anything about it, but i hope you folks find the problem. So to clears this up: Basically are the problems 1 and 2 resolved by a workaround. The docs should mention this in a more visible way. |
Testing, I find 3 is resolved by #5333 |
I've created #5338 to change the default behaviour for 1, since I realised that GIF already behaves in this way. |
Really great! 🥳 Greets |
What did you do?
Converted some animated gifs to animated webp. Used different qualtity settings.
What did you expect to happen?
Getting a identical converted image. Beside the(logical) format and possible size change.
What actually happened?
Webp outputs are defect. Three different problems appear.
The output images:
ps.: Converting the same images with the same settings with webp CLI tools works without issues.
What are your OS, Python and Pillow versions?
Code example
Python:
Shell variant:
Example images
Content of the archive:
anim.tar.gz
The text was updated successfully, but these errors were encountered: