By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 1,969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

save animated GIF in Python Image Library

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
"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.