Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


Python Graphics: Combining Raster and Vector Pictures

Dec 03, 2010, 22:34 (0 Talkback[s])
(Other stories by Mike Ohlson De Fine)

[ Thanks to Ramsai for this link. ]

"Vector graphics can be shrunk and expanded to any size and in any direction using simple algebra. They can be animated with rotations using basic trigonometry. Raster graphics are limited. They cannot be resized or rotated dynamically while the code is executing. They are more cumbersome. However, we can get tremendous effects when we combine both vector and raster graphics together. The one thing that Python cannot do is to rotate a GIF image by itself. There are ways of mimicking rotation reasonably but there are limitations you will appreciate after trying out some of these recipes. PIL can rotate them, but not dynamically on a Tkinter canvas. We explore some possibilities and workarounds here.

"In this article by Mike Ohlson de Fine, author of Python 2.6 Graphics Cookbook, we will cover:

* Simple animation of a GIF beach ball
* The vector walking creature
* Bird with shoes walking in the karroo
* Making a partially transparent image with GIMP
* Diplomat walking at the palace
* Spider in the forest
* Moving band of images
* Continuous band of images
* Endless background – a passing cloudscape"

Complete Story

Related Stories: