Starting from a sequence of static images (for example called frame01.jpg, frame02.jpg and so on) an animated gif can be created using the following command:
magick -delay 10 -loop 0 frame*.jpg animation.gif
-delay 10
sets the interval between the frames to 0.1 seconds
-loop 0
creates an infinite looping animation