Q:

Defining a screen in PyGame and not show it

I'm writing a script on PyGame that should create an image and save it, not show it. The process of generating and saving is perfect, but when I use myscreen = pygame.display.set_mode([500,500]), it causes a windows to be open, on the size I'm defining. Once I'm not giving any pygame.display.flip() the window just blinks, appear and dissapear.
I would like to know if there is a way to initialize a screen in PyGame and not show it, so, I could create my image and just save it.

A:

Don't use display to create it.  You can just construct a Surface and use it in conjunction with image.save() to save it, or use something like Pillow to create an image without using PyGame at all.

