pygame: output to file?

Temia Eszteri lamialily at cleverpun.com
Tue Apr 17 03:25:05 EDT 2012


Okay, superpollo. I'm looking at a few possible ways to do this (the
Zen of Python hates me, even though I'm dutch-blooded!), and I'd like
to ask a couple more questions before I dive into writing up a
solution.

First, are you simply trying to capture the framebuffer of a
Pygame-made game in realtime, or are you using Pygame to explicitly
render and build a movie or GIF animation sequence? I need to know
what kind of overhead is permissible, and in the former case I know
there won't be a lot of allowance due to how slow Pygame's drawing
operations can get when they stack up, especially at high resolutions.

Secondly, how much are you willing to install to have a means to do
this? Because from the looks of things, this'll have to either be
tackled with:

* ImageMagick (http://www.imagemagick.org/) as Ian suggested - the
ctypes binding I found for this was too immature to use, and the other
option will require compiling,
* A branch someone on EsperNet pointed me to called GraphicsMagick
(http://www.graphicsmagick.org/) - haven't looked into this much so I
can't comment on it yet,
* or a module I found on Google Code that greatly extends from PIL's
meager GIF-handling abilities, images2gif
(http://code.google.com/p/visvis/source/browse/vvmovie/images2gif.py).

Let me know what you think of the options, and I'm sorry this has
gotten a little too complex. I was hoping animated GIF sequencing in
Python would be a simple matter too!

~Temia
--
When on earth, do as the earthlings do.



More information about the Python-list mailing list