Watermark GIF with Python PIL
Question: I'm trying to find a way to watermark a gif image, below is my code:

    
    
    img = Image.open("my.gif")
    watermark = Image.open("watermark.gif")
    
    img.paste(watermark, (1, 1))
    img.save("out.gif")
    

File: my.gif:

![my.gif](http://i.stack.imgur.com/5vCFj.gif)

File: watermark.gif:

![Watermark Gif](http://i.stack.imgur.com/Zio4y.gif)

the output "out.gif" is no longer animated, it shows one frame with the
watermark: ![Out.gif](http://i.stack.imgur.com/MpNrI.gif)

I know that PIL supports the GIF format, so I must be doing something wrong.
All help is appreciated.


Answer: Animated GIFs are actually a sequence of images with rules and times for
switching between them you need to modify all of them and output all of them -
you can use [images2gif](http://i.stack.imgur.com/Khnut.gif) for this - or you
can do a lot of work yourself.

Example of using images2gif, after downloading from the above link:

    
    
    from PIL import Image
    import images2gif as i2g
    images = i2g.readGif('Animated.gif', False)
    watermark = Image.open("Watermark.gif")
    for i in images: i.paste(watermark, (1, 1))
    
    i2g.writeGif('Out.gif', images, 0.5) # You may wish to play with the timing, etc.
    exit()
    

And the results: ![enter image description
here](http://i.stack.imgur.com/Khnut.gif)

