duration = 2
ncircles = 20

def make_frame(t):
    surface = gz.Surface(W, H)
for i in range(ncircles):
    angle = 2 * np.pi * (1.0 * i / ncircles + t / duration)
center = W * (0.5 + gz.polar2cart(0.1, angle))
circle = gz.circle(r=W * (1.0 - 1.0 * i / ncircles), xy=center, fill=(i % 2,
    i % 2, i % 2))
circle.draw(surface)
return surface.get_npimage()
clip = mpy.VideoClip(make_frame, duration=duration)
clip.write_gif('circles.gif', fps=15, opt='OptimizePlus', fuzz=10)
Создание анимации с использованием Python Gizeh