472,964 Members | 2,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,964 software developers and data experts.

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:


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 4342
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:

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)


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

"Pekka Karjalainen" <pk******@paju.oulu.fi> wrote in message
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: F. GEIGER | last post by:
Hi all, I'm dev'ing a control app, that has as a part of it a window showing CAD-drawings. So I'd like to display drawings coming from DXF files. In the first place I'd start displaying...
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
by: rbt | last post by:
Are there any plans in the near future to support PDF files in Python as thoroughly and completely as Perl does? http://cpan.uwinnipeg.ca/search?query=pdf&mode=dist I love Python's clean...
by: Eckhoff, Michael A | last post by:
Hello, I failed to locate a list for pygtk, so I thought I'd ask my question here. Is it possible to write CGI scripts that bring up a GUI (as in GTK+, QT, Tk, ...) or an openGL display that is...
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
by: Michael Galvin | last post by:
I am trying to use Python to send to the printer a calender filled with a mix of text and simple graphics. I want to draw on the printed page something like a table with 6 rows and 7 columns to...
by: Paulo da Silva | last post by:
I need to make some data representation. Basically a major window for a 2D chart, a scrollable window with some few small 2D graphics. The rest is a normal form with buttons, labels and entries....
by: isinc | last post by:
I have an assignment that I'm working on and am having trouble. Not too familiar with graphics. Any help/guidance would be much appreciated to see if what I have so far is okay and what I should do...
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.