code: def make_movie(workdir, pf, dpi=120, fps=1, format="pdf", engine="ffmpeg"):
      
      os.chdir(workdir)
      if format != "png":
          cmd  = "parallel convert -density {}".format(dpi)
          cmd += " {} {.}.png ::: " + "*.{}".format(format)
          sh(cmd)
  
      assert engine in ("ffmpeg", "gifsicle"), \
              "Only ffmpeg or gifsicle is currently supported"
      if engine == "ffmpeg":
          cmd = "ffmpeg -framerate {} -pattern_type glob -i '*.png' {}.mp4"\
                  .format(fps, pf)
      elif engine == "gifsicle":
          cmd  = "convert *.png gif:- |"
          cmd += " gifsicle --delay {} --loop --optimize=3".format(100 / fps)
          cmd += " --colors=256 --multifile - > {}.gif".format(pf)
  
      sh(cmd)
docs: Make the movie using either ffmpeg or gifsicle.