@@ -0,0 +1,527 @@
+import numpy as np%0A%0Adef overlay(size, count, sources, color=(255, 255, 255)):%0A    '''%0A    Create a sequence of frames by overlaying the sources%0A    onto a blank background%0A    '''%0A    for i in range(count):%0A        background = np.empty((size%5B1%5D, size%5B0%5D, 3), dtype=np.uint8)%0A        background%5B:, :%5D = color%0A        for source, pos in sources:%0A            frame = next(source)%0A            background%5Bpos%5B1%5D:pos%5B1%5D+frame.shape%5B1%5D,%0A                       pos%5B0%5D:pos%5B0%5D+frame.shape%5B0%5D%5D = frame%0A        yield background%0A        %0A%0A

Add compose module