[MMTK] Visualization to an image file

Peter mmtk at maubp.freeserve.co.uk
Fri Jul 9 14:46:34 CEST 2004

Have any of you been able to use Python to save or export an MMTK
visualisation to an image file (in any format, for example .PNG .GIF
.BMP etc)?

I can use MMTK to invoke a visualisation using VRML, VRML2, VMD or VPython.

Some of these programs can export/save/render to a graphics file, and if
not then there is hallways the option of doing a screen capture.  But,
this is manual, and I want this to happen automatically in code.

I suspect the easiest method may be to generate and call a VMD script
file that loads a scene and then saves it (probably using the render
snapshot command).

Any other suggestions?  For example, I would have expected VPython to be
able to save its pictures to files - but as far as I could see it doesn't.

The only other idea I could find with some Internet searching was to
make a system call to an external graphics package like ImageMagick to
take a screen capture of the entire screen.  If the window was
positioned in a know place this would allow automatic cropping to get
just the desired image.



More information about the mmtk mailing list