On-the-fly generation of stimuli from natural images