Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89cd9e7

Browse files
committed
DOC: Clarify supported animation formats in animation tutorial
- fix table to state the same as the text (ImageMagickWriter supports all formats supported by imagemagick) and add some examples (the extra args for apng are needed to reduce filesize by ~10x) - add .webp as supported format to Pillow (since 2018 vers 5.0.0 ) - fix table formatting
1 parent bdf178e commit 89cd9e7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tutorials/introductory/animation_tutorial.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ def update(frame):
178178
# ========================================== ===========================
179179
# Writer Supported Formats
180180
# ========================================== ===========================
181-
# `~matplotlib.animation.PillowWriter` .gif, .apng
181+
# `~matplotlib.animation.PillowWriter` .gif, .apng, .webp
182182
# `~matplotlib.animation.HTMLWriter` .htm, .html, .png
183-
# `~matplotlib.animation.FFMpegWriter` All formats supported by
184-
# *ffmpeg*
185-
# `~matplotlib.animation.ImageMagickWriter` .gif
183+
# `~matplotlib.animation.FFMpegWriter` All formats supported by *ffmpeg*
184+
# `~matplotlib.animation.ImageMagickWriter` All formats supported by
185+
# *imagemagick*
186186
# ========================================== ===========================
187187
#
188188
# To save animations using any of the writers, we can use the
@@ -218,6 +218,11 @@ def update(frame):
218218
# Imagemagick writers::
219219
#
220220
# ani.save(filename="/tmp/imagemagick_example.gif", writer="imagemagick")
221+
# ani.save(filename="/tmp/imagemagick_example.webp", writer="imagemagick")
222+
# ani.save(filename="apng:/tmp/imagemagick_example.apng",
223+
# writer="imagemagick", extra_args=["-quality", "100"])
224+
#
225+
# (the ``extra_args`` for apng are needed to reduce filesize by ~10x)
221226
#
222227
# Since the frames are piped out to *ffmpeg* or *imagemagick*,
223228
# ``writer="ffmpeg"`` and ``writer="imagemagick"`` support all formats

0 commit comments

Comments
 (0)