473,379 Members | 1,326 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,379 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:

<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 4360
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
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...
1
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'
25
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...
5
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...
4
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...
7
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...
3
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....
7
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...
3
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
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.