Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is based on http://www.imagemagick.org/Usage/anim_mods/#append. 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 -b pic3 pic1.anim

You should have pic3_anim.gif with the two animation vertically stacked. If you change -append to +append you get them side by side.

This is based on http://www.imagemagick.org/Usage/anim_mods/#append. 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_anim.gifpic3.gif with the two animation vertically stacked. If you change -append to +append you get them side by side.

This is based on http://www.imagemagick.org/Usage/anim_mods/#append. http://www.imagemagick.org/Usage/anim_mods/#append . 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.