Skip to content

Ways of running py5 without a window #351

Answered by hx2A
villares asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, there are two ways, but it might still require a frame buffer (display) for it to run (I don't remember right now).

First, you can use the special HIDDEN renderer, ie py5.size(200, 200, py5.HIDDEN). It inherits from the Java2D renderer and does not open a window. This renderer exists specifically to provide a better experience for py5bot and other times I don't want py5 to open a window. This renderer isn't really advertised anywhere and basically exists for internal purposes.

The other option is to use the py5 functions py5.render_frame() or the associated decorator @render(). They will return a PIL image that you can then save to a PNG file.

https://py5coding.org/reference/py5funct…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by villares
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants