|
Re: about animation gif file: msg#00208python.pygame
On Saturday 24 September 2005 03:17 am, Kris Schnee wrote: > flya flya wrote: > > some gif file has many frames to paly animation,Can pygame load these > > frames? and do the animation? > > Yes. Load the GIF as a Surface. Make a bunch of Rect objects > representing where in the image each frame is. Use those as clipping > regions. Are you saying that the loader will automatically load the animated GIF by separating each frame out spatially on the Surface? If so, it has to be pretty smart, and these aren't sufficient instructions for figuring out what it does. We're talking about a multi-frame format in the GIF, not frames spread out on a static GIF. There is no such thing as "where in the image each frame is" -- they are in the same place, they are separated by *time* (i.e. frame number), and therefore by where they are stored in the file, but there's no such thing as a separate clipping rectangle for each frame as you seem to be imagining. Most single-frame image tools only load the *first* frame of an animated GIF and ignore the rest. I would naively suspect that this is what will happen if you try to load one with PIL (which I think is what you must do to load any image into PyGame unless it's in Microsoft BMP format -- which I must say seems like a strange choice of native format ;-) ), but I haven't tried it myself, so I'm not sure. You can do some trickery on the command line to change an animated GIF to the kind of format you are thinking of, using ImageMagick, though I'd have to spend some time with the man pages to figure out how. You might be able to do the same with PIL, though I have doubts, since PIL doesn't provide all that much support for GIF. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: noise added on OGG playback: 00208, Marek Kubica |
|---|---|
| Next by Date: | Re: about animation gif file: 00208, Dan |
| Previous by Thread: | Re: about animation gif filei: 00208, Kris Schnee |
| Next by Thread: | Re: about animation gif file: 00208, Christopher Arndt |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |