Save image created via createGraphics to server

Hello, I’ve got a simple (probably not so simple) problem - sending an image generated via createGraphics function to an e-mail. So what I thought is - use a php script on the server to send an e-mail. So far so good, but the issue is sending the image from p5.js to the server where php resides. I can’t use the toDataURL() function, since it doesn’t work with this kind of object that I get with createGraphics() function. I’ve tried passing the image as a JSONed pixels array, but it takes like 100MB of data :smiley: So it’s not a good option.
Does anyone have any solutions of sending the p5.js image data to the server?

1 Like

p5js.org/reference/#/p5.Element/elt

Undocumented shortcut to a p5.Graphics’s drawing context: pg._renderer.drawingContext

1 Like