Moviepy's ImageSequenceClip() reads PNGs wrongly like 0, 10, 100 instead of traditional counting

为君一笑 提交于 2020-06-17 02:50:27

问题


So I have this for-loop that creates a photo of each earthquake and names them earthquake0, earthquake1, earthquake2, and so on.

plt.savefig("exports\earthquake{0}.png".format(i))

To convert these images to GIF, I use this

image_list='exports'
my_clip = ImageSequenceClip(image_list, fps=0.75)
my_clip.write_gif('eqph_gif.gif')

However, ImageSequenceClip() reads the files like earthquake0.png, earthquake10.png, earthquake100.png. How do I make my code read the photos traditionally like 0, 1, 2, 3, and until the last number which is 187?

来源:https://stackoverflow.com/questions/62084686/moviepys-imagesequenceclip-reads-pngs-wrongly-like-0-10-100-instead-of-trad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!