Problem: When saving a sequence of images as a lossless WebP animation using PIL, the last pixel (bottom-right) becomes black.
<code>from PIL import Image
for png_file in png_files:
image = Image.open(image_path).convert('RGBA')
...
images[0].save("animation.webp", save_all=True, append_images=images[1:], duration = 20, lossless=True)
</code>
<code>from PIL import Image
for png_file in png_files:
image = Image.open(image_path).convert('RGBA')
...
images[0].save("animation.webp", save_all=True, append_images=images[1:], duration = 20, lossless=True)
</code>
from PIL import Image
for png_file in png_files:
image = Image.open(image_path).convert('RGBA')
...
images[0].save("animation.webp", save_all=True, append_images=images[1:], duration = 20, lossless=True)
It doesn’t always happen, but happens more often than not. It looks like a real bug in some library.
When asked, a large language model said this is a known bug in the Pillow library when saving WebP format, but I can’t find any evidence that this is true.
1