Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can p5 be used as headless library? #339

Open
lanyusan opened this issue Apr 3, 2022 · 8 comments
Open

Can p5 be used as headless library? #339

lanyusan opened this issue Apr 3, 2022 · 8 comments

Comments

@lanyusan
Copy link

lanyusan commented Apr 3, 2022

I am using pycairo as headless canvas. But its API isn't compatible with processing's.

If P5 can be used as headless canvas, it would be great.

If yes, how to use it? I couldn't find such information from doc.

Thanks

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2022

Thank you for submitting your first issue to p5py

@tushar5526
Copy link
Member

There isn't direct support as of now for p5py to be used headlessly, you could however use virtual frame buffers.

@martynvdijke
Copy link

How would one go about this ?
I basically want to generate (for now) an image headless grab the image and save to png for usage.

@martynvdijke
Copy link

I did some digging, I can some a long way by running the rendering process in a separate thread.
But I cannot find a way to prevent the preview window to pop up

@ivanlen
Copy link

ivanlen commented Jun 12, 2024

Is there any progress on this front?
I would like to use p5 in a jupyter notebook for example and render the images there somehow, is that possible?

@tushar5526
Copy link
Member

@ivanlen it's still a WIP, but you can checkout https://py5coding.org/index.html which supports this.

@ivanlen
Copy link

ivanlen commented Jun 12, 2024

@ivanlen it's still a WIP, but you can checkout https://py5coding.org/index.html which supports this.
@tushar5526

Yes thanks!, already saw that one but they are using ipython kernel as backend which is not currently compatible with ARM mac architecture. I was able to make work p5py with mac and thats why I interested in using it that way.

@tushar5526
Copy link
Member

@ivanlen one of our 2D rendering backend skia supports this feature - but it's still a WIP and I am not sure if I can find time for it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants