Why is my gif missing png files after 753 iterations

£可爱£侵袭症+ 提交于 2019-12-12 04:07:29

问题


I'm using the following python code to generate a .gif file from about 3000 .png files. But the .gif file has only about 1000 .png files. Why is the .gif not having all the .png files? Is there a limit to the number of .png files I can combine to create a .gif file?

import imageio
import os

filenames =[]
dirPath = "D:\\BandSim_2017-06-20_12_00_45\\"
for file in os.listdir(dirPath):
     if file.endswith(".png"):
         filenames.append(dirPath+file)
moviePath ="D:\\simulation.gif"
with imageio.get_writer(moviePath,mode='I', duration=0.1) as writer:
i=0
for filename in filenames:
    image = imageio.imread(filename)
    writer.append_data(image)
    print filename

来源:https://stackoverflow.com/questions/44650649/why-is-my-gif-missing-png-files-after-753-iterations

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