Loop animated .gif in python mode

Thank you villares,
This is exactly what I was seeking.

A note on the STEP 2 of the instruction above:

In order for the library to install correctly ensure you rename the unzipped Folder from /gif-animation-3.0 to /gifAnimation

I made a simple python example using the included “lavalamp.gif” file for anyone interested.

// JSGauthier
// Make a .gif loop using the gifAnimation library in python mode.

add_library('gifAnimation')

def setup():
    size(1000,1000)
    global G
    G = Gif(this, "lavalamp.gif")

def draw():
    background(0)
    G.loop()
    imageMode(CENTER)
    image(G, mouseX,mouseY)
1 Like