sprites for games

Hi .
I need a python script or just some ideas about how to make this :
http://t2.gstatic.com/images?q=tbn:ANd9GcQva1Y8pfQ7WlSFjHAf3eK65K7PHh5xaIRmUHJEbTVxR4VdVgUA
I need to export a complex animation in a single image. Png
The problem does not appear on camera movement, because you can rotate the object but when combined into a single image.

Export you animation as *.png (or *.jpg), import them (as layers all at once) into e.g. Gimp
Make a big image and copy paste the layers into the big image and drag them to a place you want.
Save the result as png …

Your solution is nice , but I expect a blender 3d + python solution.
Maybe using PIL module or something else.
I thinking how to creat sprites by using 3D mesh and armature .
This allow me to create many poses in sprites .
Thank you for your solution.

PIL is not available (import pil as wel as import PIL, failed)