Skip to main content
Fixing URL - example script moved to a separate repo since Pillow 5.0.0 + adding some more info
Source Link

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said here, there is a Pillow example on githubgithub.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()

Note: This example is outdated (gifmaker is not an importable module, only a script). Pillow has a GifImagePlugin (whose source is on GitHub), but the doc on ImageSequence seems to indicate limited support (reading only)

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said here, there is a Pillow example on github.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said here, there is a Pillow example on github.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()

Note: This example is outdated (gifmaker is not an importable module, only a script). Pillow has a GifImagePlugin (whose source is on GitHub), but the doc on ImageSequence seems to indicate limited support (reading only)

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said herehere, there is a Pillow example on github.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said here, there is a Pillow example on github.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said here, there is a Pillow example on github.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()
Source Link
Nathan
  • 145
  • 1
  • 5

Like Warren said last year, this is an old question. Since people still seem to be viewing the page, I'd like to redirect them to a more modern solution. Like blakev said here, there is a Pillow example on github.

 import ImageSequence
 import Image
 import gifmaker
 sequence = []

 im = Image.open(....)

 # im is your original image
 frames = [frame.copy() for frame in ImageSequence.Iterator(im)]

 # write GIF animation
 fp = open("out.gif", "wb")
 gifmaker.makedelta(fp, frames)
 fp.close()