I have tried reading a lot of examples online and found imageio is the perfect package for it. Also found examples written in here.
imageio
I have just followed
in case anyone needs it, for python 3.6.8, it needed fps
fps
imageio.mimsave('/path/file.gif',images,fps=55)