问题
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