0

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
user77005
  • 1,769
  • 4
  • 18
  • 26
  • can you check by printing `filenames` array and see if all the file names are present in there? – jkhadka Jun 21 '17 at 11:28
  • I checked. All 3000 of them are there. Finally, I just decided to create multiple .gif files because I couldn't find any other way to resolve it. Posted in the imageio group too. – user77005 Jun 21 '17 at 12:18

0 Answers0