Hi,
There are many ways to generate visual stimuli (no one universal method). For the Allen Brain Observatory, we built our stimulus code on this python package: https://www.psychopy.org/. Psychopy has many users and very helpful documentation and community boards. I might recommend starting there. If you’d like to get more detail about the stimuli shown in the brain observatory datasets, check out this post:
I hope that helps!
Cheers,
Corbett