pysimplegui animated gif
from PIL import Image, ImageTk, ImageSequence
import PySimpleGUI as sg
gif_filename = r'ExampleGIF.gif'
layout = [[
[sg.Image(filename=gif_filename,
enable_events=True,
key="-IMAGE-")]
]]
window = sg.Window('Window Title', layout, finalize=True) #finalize is important!
while True:
for frame in ImageSequence.Iterator(Image.open(gif_filename)):
event, values = window.read(timeout=100)
window['-IMAGE-'].update(data=ImageTk.PhotoImage(frame) )