p5py / p5

p5 is a Python package based on the core ideas of Processing.
https://p5.readthedocs.io
GNU General Public License v3.0
728 stars 120 forks source link

Can p5 be used as headless library? #339

Open lanyusan opened 2 years ago

lanyusan commented 2 years ago

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[bot] commented 2 years ago

Thank you for submitting your first issue to p5py

tushar5526 commented 2 years ago

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

martynvdijke commented 5 months ago

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 commented 5 months ago

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 commented 4 months ago

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 commented 4 months ago

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

ivanlen commented 4 months ago

@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 commented 4 months ago

@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.