471,319 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

save animated GIF in Python Image Library

hi,
how can i save an animated GIF with PIL?

e.g. to rotate all frames of an image i tried the following:

im = Image.open('anim.gif')
for f in ImageSequence(im): #using the class from the PIL handbook
if f:
f = f.rotate(180)
im.save('animrotated.gif')

problem is that only one frame (i guess the last one) is saved.
i could not find any options for saving GIFs in the handbook.

can this be done at all?

thanks
christof

Jul 18 '05 #1
1 4103
"christof hoeke" <cs***@yahoo.com> wrote:
how can i save an animated GIF with PIL?

e.g. to rotate all frames of an image i tried the following:

im = Image.open('anim.gif')
for f in ImageSequence(im): #using the class from the PIL handbook
if f:
f = f.rotate(180)
im.save('animrotated.gif')

problem is that only one frame (i guess the last one) is saved.
i could not find any options for saving GIFs in the handbook.

can this be done at all?


see the "gifmaker" example in the Scripts directory.

(get the PIL source distribution if you don't have it)

</F>


Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Altman | last post: by
2 posts views Thread by Miha Ambroz | last post: by
1 post views Thread by liuliuliu | last post: by
4 posts views Thread by Lando | last post: by
27 posts views Thread by Phil | last post: by
reply views Thread by helraizer1 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.