iconEuler Reference

Animated GIF or MPEG

Load this file with "load makeanimations".

Functions to make an animated GIF or an MPEG movie.

function makegif (f$:string, x:real vector,
    filename:string="animation", show=true,
    w:index=none, h:index=none, antialias=true)
  Makes an animated GIF
  
  The procedure calls f$(x[i]) for the values in the row vector x. f$
  should be a plot function depending on this variable. In the
  current directory, images with names im000.png, im001.png etc will
  be generated. These images are deleted later.
  
  The function calls the program convert to produce an animated GIF
  from the images. This function is part of the suite by ImageMagick.
  After the work is done, the PNG files are deleted and the default
  viewer for GIF files is called.
  
  http://www.imagemagick.org/
  
  filename : Filename for images and animation.
  show : Show the GIF in the default viewer after it has been
  generated.
  
  >function oneplot (a) ...
  $  plot2d("sin(x+a)";a,a=0,b=2pi,c=-1,d=1,color=red,thickness=3);
  $  endfunction
  >load makeanimations
  >makegif("oneplot",(0:99)/100*2pi,"animation");
  >fileremove("animation.gif");
  
  See: 
makempeg (Animated GIF or MPEG)
function makempeg (f$:string, x:real vector,
    filename:string="animation", show=true,
    w:index=none, h:index=none, antialias=true,
    quality=100)
  Makes an animated GIF
  
  This functions works in the same way as makegif().
  
  filename : Filename for images and animation.
  show : Show the GIF in the default viewer after it has been
  generated.
  
  >function oneplot (a) ...
  $  plot2d("sin(x+a)";a,a=0,b=2pi,c=-1,d=1,color=red,thickness=3);
  $  endfunction
  >load makeanimations
  >makegif("oneplot",(0:99)/100*2pi,"animation");
  >fileremove("animation.gif");
  

Documentation Homepage