Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 699 Bytes

ImageSequence.rst

File metadata and controls

27 lines (18 loc) · 699 Bytes

:pyImageSequence Module

The :pyImageSequence module contains a wrapper class that lets you iterate over the frames of an image sequence.

Extracting frames from an animation

from PIL import Image, ImageSequence

im = Image.open("animation.fli")

index = 1
for frame in ImageSequence.Iterator(im):
    frame.save("frame%d.png" % index)
    index += 1

The :py~PIL.ImageSequence.Iterator class

PIL.ImageSequence.Iterator