This is based on http://www.imagemagick.org/Usage/anim... . Naturally, you need imagemagick installed.
Say you created pic1.gif
and pic2.gif
, with the same number of frames:
sage: animate([sin(x + float(k)) for k in srange(0,2*pi,0.3)],xmin=0, xmax=2*pi, figsize=[2,1]).save('pic1.gif')
sage: animate([cos(x + float(k)) for k in srange(0,2*pi,0.3)],xmin=0, xmax=2*pi, figsize=[2,1]).save('pic2.gif')
Download and make executable the scripts here and here.
Execute the following, changing NUM_FRAMES to the number of frames (21 here, look at the files generated by gif2anim
if you are not sure):
gif2anim -c pic1.gif
gif2anim -c pic2.gif
for i in `seq -f '%03g' 1 NUM_FRAMES`; do convert pic1_$i.gif pic2_$i.gif -append pic3_$i.gif; done
anim2gif -c -g -b pic3 pic1.anim
You should have pic3.gif
with the two animation vertically stacked. If you change -append
to +append
you get them side by side.