@muneer pointed out here that you can take an image of the canvas and it is automatically formatted in base64:
I can confirm that this works. So the code is there… it just needs to be made into a block that accepts an image input.