title: making gif from images using imageio in python
body: <p>I have tried reading a lot of examples online and found <code>imageio</code> is the perfect package for it. <a href="https://stackoverflow.com/questions/753190/programmatically-generate-video-or-animated-gif-in-python">Also found examples written in here</a>.   </p>
  
  <p>I have just followed the example as shown and tried the following </p>
  
  <pre><code>import imageio as io
  import os
  file_names = sorted((fn for fn in os.listdir('.') if fn.startswith('surface')))
  #making animation
  with io.get_writer('surface.gif', mode='I', duration=0.5) as writer:
      for filename in file_names:
          image = io.imread(filename)
          writer.append_data(image)
  writer.close()
  </code></pre>
  
  <p>and another example.   </p>
  
  <pre><code>images = []
  for filename in file_names:
      images.append(io.imread(filename))
  io.mimsave('surface1.gif', images, duration = 0.5)
  </code></pre>
  
  <p>both of these do not work. And basically i only see the first frame from the gif and a blink and finish. The duration is set 0.5secs, so it should work fine. I might have been missing out something here. </p>