Check frame durations as well as frame count when saving animation. In this invented three-color WebP, one existing save call kept all three frames but shortened their timing.
Playback starts paused. Each Play button animates a small red/green/blue square. Stop returns it to the static first frame. Downloads contain the exact saved example files.
Pillow 9.4.0 / libwebp 1.2.4 saved the same invented 16×16 input in three ways. Default save retained one frame. Adding save_all=True retained three frames with 120/120/120 ms durations. Supplying the recorded duration list and loop retained 120/240/360 ms; this output was byte-identical to the original.
Independent RIFF parsing, Pillow decoding and Chromium ImageDecoder agreed on frame content and durations. A separate Chromium 156.0.8078.47 run retained 65 screenshots over 2.398 seconds. The faster output's complete sampled cycle bounds were 293–425 ms; original and explicit output were 642–792 ms. Sampling is coarse; these are interval bounds, not exact measured frame boundaries. The static file stayed red.
Exact save calls for this fixture
from PIL import Image
# These three calls were compared on the same original.webp.
with Image.open("original.webp") as im:
im.save("default.webp", lossless=True)
with Image.open("original.webp") as im:
im.save("all.webp", save_all=True, lossless=True)
with Image.open("original.webp") as im:
durations = []
for i in range(im.n_frames):
im.seek(i)
im.load()
durations.append(im.info["duration"])
im.seek(0)
im.save("explicit.webp", save_all=True, lossless=True,
duration=durations, loop=im.info["loop"])
Current Pillow documentation describes animation save options. Current-version behavior was not executed here. These old-version observations are specific to these calls and this file.
This page replays saved files; it runs no converter and accepts no uploads. The colored squares are invented, not customer artwork. Other applications, current Pillow, partial frames, transparency, disposal, metadata, physical devices and operator usefulness remain untested. No customer results or paid service are claimed.
If an animation changes in your work, describe the application/build, whether you were opening or exporting, and whether frames or speed changed. Please omit private files.