The assumption here is that you always read a stimulus from a numpy array stored in a file? Would it make sense to also allow passing an array that is in memory? For example, if you have some stimulus-presentation code that generates your experimental stimuli, you might want to use that here to generate arrays, instead of saving the frame-buffer output like you do.