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

Pillow animated gif support #6567

Open
aclark4life opened this issue Nov 20, 2020 · 2 comments
Open

Pillow animated gif support #6567

aclark4life opened this issue Nov 20, 2020 · 2 comments

Comments

@aclark4life
Copy link

Hey all, Pillow fork author (and wagtail user!) here, wagtail docs say "pillow does not support animated gifs" https://docs.wagtail.io/en/stable/advanced_topics/images/animated_gifs.html#animated-gif-support

But AFAICT we do support them, for some value of support: https://www.google.com/search?q=python%20pillow%20animated%20gif

Am I missing something, and/or anything we can do to help wagtail? Thanks

@zerolab
Copy link
Contributor

zerolab commented Nov 20, 2020

Hey @aclark4life,

Wagtail uses https://github.com/wagtail/willow for image operations. As far as I recall at the time the library was created (and probably for a while after), Pillow did not support animated GIFs, hence the message.

@kaedroho could probably provide more context to this. In terms of helping, a PR on Willow is most welcome! Once Willow is updated we can tweak the Wagtail docs too.

@kaedroho
Copy link
Contributor

kaedroho commented Nov 22, 2020

The problems we had implementing Pillow for animated gifs are described here: wagtail/Willow#76 (comment)

In addition, animated gifs only support a 256 colour pallette, which means that the files that Pillow/Wand create look worse than the original, and they can even be larger in filesize too!

So rather than export animated GIFs, we plan to convert them to something else. Theres

  • Convert them WebP/APNG files, which have fairly good browser support now and it looks like Pillow supports these
  • Convert them into videos Pillow animated gifs Willow#76 (comment) which have great browser support and are much easier to use on the web now we have the <video> element (Twitter does this)

I personally favour using video files, but I don't think Pillow supports this so this might need to be implemented as a new Willow plugin that uses something else to encode them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants