Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
dopplershift merged 1 commit intomatplotlib:mainfromanntzer:op
Jun 30, 2022

Conversation

anntzer
Copy link
Contributor

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. (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

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@dopplershift
Copy link
Contributor

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.
@anntzer
Copy link
ContributorAuthor

rebased.

@QuLogic
Copy link
Member

Do we have a minimum supported ImageMagick version? When was this added?

story645
story645 previously approved these changesJun 30, 2022
@story645story645 dismissed theirstale reviewJune 30, 2022 02:31

accidentally pushed button

@anntzer
Copy link
ContributorAuthor

I don't know when it was added exactly, buthttps://legacy.imagemagick.org/Usage/anim_opt/ dates back to 2007 and already mentions it.

@jklymak
Copy link
Member

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.

@dopplershift
Copy link
Contributor

@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.

timhoffm reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@dopplershiftdopplershiftdopplershift approved these changes

@story645story645story645 left review comments

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

6 participants
@anntzer@dopplershift@QuLogic@jklymak@tacaswell@story645

[8]ページ先頭

©2009-2025 Movatter.jp