I know how to save the canvas using p5.js. However I want to save the canvas as a very large png (for example 8000×8000) so that I can use it in Photoshop and scale down the image to the appropriate size. Is there a simple way of doing this besides creating a new canvas behind the scenes that is too large for the browser window?
2
Answers
You could use the
createGraphics()
function to create an off-screen buffer. Then you can draw it to the screen using theimage()
function, or you can call itssave()
function to store it as a file. Here’s an example:Draw everything into a pGraphics object.
Normally you draw this “output” just as an image to the canvas.
But if you want to export a high-res version of it, you scale it up first.