48.5 Generating External Animations from Nam

Nam animations can be saved and converted to animated gifs or MPEG movies.

To save the frames of your movie, first start nam with your trace and set it up where you want it to start and adjust other parameters (step rate, size, etc.) Select 'Record Animation' from the File menu to start saving frames. Each animation step will be saved in a X-window dump file called ``nam%d.xwd'' where %d is the frame number. These files can then be assembled into animated GIFs or MPEGs with the appropriate post-processing tools.

The following shell script (sh, not csh) converts these files into an animated gif:

    for i in *.xwd; do
    	xwdtoppm \<$i |
    	ppmtogif -interlace -transparent'#e5e5e5' \>`basename $i .xwd`.gif;
    done
    gifmerge -l0 -2 -229,229,229 *.gif \>movie.gif

Please note that the programs xwdtoppm, ppmtogif, and gifmerge are not part of ns. You can get the first two from http://download.sourceforge.net/netpbm/and gifmerge from http://www.the-labs.com/GIFMerge/.



Tom Henderson 2011-11-05