From 2ed5944fd790c051a89bc6a790cec45a8a808ec1 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 29 Jun 2022 22:51:14 +0200 Subject: [PATCH] Default animation.convert_args to ["-layers", "OptimizePlus"]. 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. --- doc/api/next_api_changes/behavior/23371-AL.rst | 4 ++++ lib/matplotlib/mpl-data/matplotlibrc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 doc/api/next_api_changes/behavior/23371-AL.rst diff --git a/doc/api/next_api_changes/behavior/23371-AL.rst b/doc/api/next_api_changes/behavior/23371-AL.rst new file mode 100644 index 000000000000..4e70f123347c --- /dev/null +++ b/doc/api/next_api_changes/behavior/23371-AL.rst @@ -0,0 +1,4 @@ +The default ``rcParams["animation.convert_args"]`` changed +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +It now defaults to ``["-layers", "OptimizePlus"]`` to try to generate smaller +GIFs. Set it back to an empty list to recover the previous behavior. diff --git a/lib/matplotlib/mpl-data/matplotlibrc b/lib/matplotlib/mpl-data/matplotlibrc index b4d3b850836a..bfa973d7f80d 100644 --- a/lib/matplotlib/mpl-data/matplotlibrc +++ b/lib/matplotlib/mpl-data/matplotlibrc @@ -779,7 +779,7 @@ ## ImageMagick in the registry (as convert is also the name of a system tool). #animation.convert_path: convert ## Additional arguments to pass to convert. -#animation.convert_args: +#animation.convert_args: -layers, OptimizePlus # #animation.embed_limit: 20.0 # Limit, in MB, of size of base64 encoded # animation in HTML (i.e. IPython notebook)