Putting 3-D Circuit Animations from
The Circuit Animation Toolbox on the Web

We have had the best results putting line-art animations on the web using GIF format.  Typical video compression schemes do poorly because they are designed for photographic images--they result in large file sizes and poor quality when used with circuit animations.  Another format that can be expected to work well is MNG ( Multiple-image Network Graphics ), based on the corresponding PNG ( Portable Network Graphics ) format.  

The process we have used works as follows.  We save graphics from MATLAB to an uncompressed avi file (because the available compression schemes don't work well).  Then we use GIF Contruction Set Professional , an inexpensive shareware program by Alchemy Mindworks , to convert to GIF and compress the files.  Alchemy Mindworks' PNG/MNGContruction Set Professional should work similarly for MNG animations.  The detailed process is outlined below

Please email me a link to animations you create, so that we can put a link to it on the page of animations on-line .



Step-by-step instructions for putting animations on the Web.

  1. Modify the m-file for the circuit you wish to animate by using saveanimation(....) in place of canimate(...), using the same arguments.  A nice way to do this is to add an optional input argument  save that is omitted to run the animation directly, or set to one to save it to disk, as in this code, which assumes three other input arguments before save.

    if nargin<4, save = 0; end   % Sets it up to not save anything if save has not been specified.
    if save
        saveanimation(t,vm,cvm,im,ca,ia,rate,switchm);
    else
       canimate(t,vm,cvm,im,ca,ia,rate,switchm);
    end


    Do not loop the animation yet--the file will be big enough (10s of MB) without looping!

  2. Run the animation and select a file to save to.  The code is set up to save a maximum of 100 frames in a single file, and to prompt you for a new filename if the animation runs more than 100 frames.  This is to keep the file sizes manageable.  If you run this on a machine with plenty of memory, you may be able to change this and use larger files--change the variable maxframes in saveanimation.  It is recommended that you leave the figure window active and not run other applications while saving the animation; otherwise bits of other images can get in the file.

  3. Launch GIF Construction Set Professional.  You may wish to quit MATLAB and other programs first, as this process will require a lot of memory

  4. Convert your avi file to gif from the 'File: Movie: Movie to GIF' menu item.  Select loop if you wish for it to loop.  Save the GIF file and repeat for each 100-frame file if your animation has been broken into multiple files.

  5. Merge the multiple files together.  Start by opening one, and positioning the insertion point where you want to add the others (typically at the end of the sequence).  Select 'Merge' from the 'Block' menu to add the frames from another file.  Repeat for as many files as the animation has been broken down into.

  6. Select the 'Supercompress' option from the file menu to compress this merged file.

  7. The animation can then be placed on the web.  It is helpful to put an html 'wrapper' on it, because some web browsers (e.g., Internet Explorer) may open a GIF file using a still image editor rather than displaying the animation in the web browser, if given the GIF file in the URL directly, rather than being pointed to an html page that containts the image.

  8. Send me a link to your animation, so that we can put a link to it on the page of animations on-line .

Back to circuit animations toolbox instructions and download or 3D circuits homepage , or jump to animations on-line , or to background information .

Thayer School of Engineering , Dartmouth College

For comments or questions email: Charles.R.Sullivan@dartmouth.edu

This page last updated on June 9, 2002
© 2002