473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 4199
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JW | last post by:
Hi, I am trying to see if I can display an animated .gif file on a Java application (that is, I do not want to have to show a series of static images to simulate animateion; I just want to...
3
by: Al | last post by:
Hi all... I have created an aspx page that contains an animated GIF. I am using javascript and location.replace to redirect from this page to another aspx page which takes several seconds to...
10
by: Liz | last post by:
All: Can anyone tell me why my animated GIF does not show up as animated when put into a pictureBox?? Thanks. Liz
3
by: Altman | last post by:
I have a object that contains a check box. When the value changes it raises an event for that object. I then have another object with a animated gif in it. I linked the event of the first object...
2
by: Miha Ambroz | last post by:
Hello, I have an application in VB 2005 in which a PictureBox is drawn onto at runtime. I would like to save the sequence of the pictures at each update into an AVI file with a user-specified...
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
4
by: Lando | last post by:
Can javascript build animated .gif or .jpeg ....I mean files *gif or *.jpeg that show animated images when are opened ( or is it another language that do it ? ) ? Thanks a lot.
27
by: Phil | last post by:
I thought it would be nice to display some animated GIFs on some of my forms. I put a PictureBox control on a form, and loaded my GIF file in. It animates, but not properly. It seems very jerky and...
0
by: helraizer1 | last post by:
Hey, I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.