Clone canvas to p5 creategraphics()

Is there a way to clone the entire p5 canvas to creategraphics? I’m trying to render a SVG using the p5.js-svg library, but I don’t want to set the entire canvas renderer to “SVG”, because I only need the output to happen at set intervals, and it takes a lot of power to write objects to both a pgraphics object and the canvas concurrently. Is there a way of somehow copying the canvas and then sending this over to a creategraphics object? I stumbled upon this, but don’t quite understand how it is implemented, it looks like it is modifying the p5 source:

This is super cool. What I’m trying to do is save as a SVG though, not as an image.
I will use this for some other project.