Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Default animation.convert_args to ["-layers", "OptimizePlus"].#23371
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This can be rebased on main now that#23370 is merged. |
On the simple_anim.py example, adding e.g.```plt.rcParams["animation.writer"] = "imagemagick"plt.rcParams["animation.convert_args"] = []ani.save("old.gif")plt.rcParams["animation.convert_args"] = ["-layers", "OptimizePlus"]ani.save("new.gif")```shows that OptimizePlus yields a >2.5x decrease in gif size.
rebased. |
Do we have a minimum supported ImageMagick version? When was this added? |
I don't know when it was added exactly, buthttps://legacy.imagemagick.org/Usage/anim_opt/ dates back to 2007 and already mentions it. |
I'm not really convinced that we should change the defaults like this, but rather users should be choosing these sorts of things depending on their application. This is presumably lossy, and I would guess the lossy-ness depends on the animation. |
@jklymak Reading thedocs linked above, I see limited mention of lossy transformations--and those cases are explicitly mentioned (LZW lossy) as unsupported. The rest of our animations in h264/mp4 are already using lossy compression, so I don't see it as an issue regardless. We should be providing defaults that make the most sense to the majority of our users. IMO, that means providing out-of-the-box functionality to produce GIF animations that have a good size-quality (image and time to write) tradeoff. So I'm fine with having these enabled since there's an escape hatch. |
On the simple_anim.py example, adding e.g.
shows that OptimizePlus yields a >2.5x decrease in gif size. (Admittedly I haven't tried more examples.)
Goes on top of#23370. Supersedes#15784. Thanks to@erelson for suggesting to use
-layers
.PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).