470,631 Members | 1,820 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

Graphics files & Python

How can I create image files and animations with Python?

I will clarify a bit. This is a question of recreational programming. I
have already made some animated gifs from Julia sets using Python and some
external programs. I hit upon a quick solution of writing ppm image files
(it's a simple text based format) and using ppmtogif to make gifs out of
them, then using gifsicle (free program found on the web) to join them
into animated gif files.

You can see some of my results in:

<http://www.student.oulu.fi/~pkarjala/animaatiot.html>

That's a small file that links to large (0.8 meg or so) files. They are
a bit bland at the moment, but I might get around to improving the things
later :-)

This seems to work well enough for the modest goals that I have -- I
just want to make a few beautiful fractal images and animations, and learn
a bit more about Python while tinkering along.

However, I might as well ask. Are there other good options for creating
images and animations using Python? As it is, I build my data into an
array representing the bitmap and the value of each pixel, and then write
it into a temp file in ppm format. It's a little slow, but it still runs
fast enough for me at the moment. I have no intention of writing a major
new fractal exploring software after all, so I'm not worried about
execution time, I'm worried about my own programmer's time (which I want
to save for other things).

Any suggestions?

--
Pekka Karjalainen - Oulu, Finland
Jul 28 '05 #1
3 4246
Am Thu, 28 Jul 2005 10:40:05 +0000 schrieb Pekka Karjalainen:
How can I create image files and animations with Python?


You can create image files with PIL:
http://www.pythonware.com/products/pil/

I don't know if you can make animated gifs.

You can use ImageMagick, too: http://www.imagemagick.org/script/index.php

You can create animated gifs with imagemagick. I use with os.system("...")
(Not the python bindings)

HTH,
Thomas

--
Thomas Güttler, http://www.thomas-guettler.de/
Jul 28 '05 #2

"Pekka Karjalainen" <pk******@paju.oulu.fi> wrote in message
news:sl*********************@lastu33.oulu.fi...
How can I create image files and animations with Python?


Besides the other responses, you might also check out the pygame site where
there once were some tutorial examples of manipulating bitmaps with
Numerical Python to get various effects.

Terry J. Reedy

Jul 28 '05 #3
In article <ma***************************************@python. org>, Terry Reedy wrote:
Besides the other responses, you might also check out the pygame site where
there once were some tutorial examples of manipulating bitmaps with
Numerical Python to get various effects.

I'll keep this in mind too. Thanks to both for helpful replies.

--
Pekka Karjalainen - Oulu, Finland

Jul 30 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by F. GEIGER | last post: by
25 posts views Thread by rbt | last post: by
5 posts views Thread by Eckhoff, Michael A | last post: by
4 posts views Thread by webdev | last post: by
3 posts views Thread by Paulo da Silva | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.