You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from PIL import Image
with Image.open("image.gif") as img:
img.save("image-animation-removed.gif")
with Image.open("image.gif") as img:
img.save("image-animation-preserved.gif", save_all=True)
This does exactly what filenames suggest. It supports animated GIFs (and probably animated webp as well, but I didnt test for these).
How about a setting: EASY_THUMBNAILS_PRESERVE_ANIMATIONS, to enable/disable animation preservation globally, in easy thumbnails? Also, to be backwards compatible?
I would be motivated to provide a PR. Digging through changelog, I saw THUMBNAIL_IMAGE_SAVE_OPTIONS, it may even already be possible?
The text was updated successfully, but these errors were encountered:
So, in theory this would work an be supported by Pillow. In real live, the original GifImagePlugin object very soon (when treated by easy thumbnail processors) becomes an PIL.Image object, and drops it's frames. I still think it should be possible to preserve GIF animations, but it would probably not be as easy as in the above snippet ;-)
benzkji
changed the title
animated gifs - preserve animation, as PIL/Pillow supports it in 2023
animated gifs - preserve animation, as PIL/Pillow supports it
Feb 5, 2024
See original closed issue #184 - I created a new issue, for a fresh start and more visibility :-)
Pillow docs: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#gif-saving
Doing a quick test on my computer:
This does exactly what filenames suggest. It supports animated GIFs (and probably animated webp as well, but I didnt test for these).
How about a setting:
EASY_THUMBNAILS_PRESERVE_ANIMATIONS
, to enable/disable animation preservation globally, in easy thumbnails? Also, to be backwards compatible?I would be motivated to provide a PR. Digging through changelog, I saw
THUMBNAIL_IMAGE_SAVE_OPTIONS
, it may even already be possible?The text was updated successfully, but these errors were encountered: