How to show image sequences as video clip on python
Question: I have a fold with a list of images which are frames extracting from a video
clip. I wonder how I can sequentially play the image sequence just as the
clip. (Hmm, FPS doesn't matter.) Checking `PIL` module and `skimage` module,
seems that no way I can do it on Python, unless I convert the `JPG` sequence
into `GIF` format.


Answer: One way would be to use the animation capability of the matplotlib library.
Here is an example copy/pasted from the [online
documentation](http://matplotlib.org/1.4.1/examples/animation/dynamic_image.html):

    
    
    #!/usr/bin/env python
    """
    An animated image
    """
    import numpy as np
    import matplotlib.pyplot as plt
    import matplotlib.animation as animation 
    
    def f(x, y):
        return np.sin(x) + np.cos(y)
    
    x = np.linspace(0, 2 * np.pi, 120)
    y = np.linspace(0, 2 * np.pi, 100).reshape(-1, 1)
    
    
    fig = plt.figure()
    im = plt.imshow(f(x, y))
    
    def updatefig(*args):
        global x,y
        x += np.pi / 15.
        y += np.pi / 20.
        im.set_array(f(x,y))
        return im,
    
    ani = animation.FuncAnimation(fig, updatefig, interval=50, blit=True)
    plt.show()
    

Few things to note are:

  * each image as to be converted to a numpy array 
  * use `im.set_array` (in the `updatefig` function) to load the next image

