code / art / projects

Converting HTML5 Canvas Elements to Images

I recently needed to do some conversions/processing to a bunch of HTML files, which contained html canvas images, so I needed a way of converting all the canvas elements on the page to PNGs.

After a bit of research and tweaking, the following worked well enough for me:

Run it in your browser’s JS console on the page you want to process (we assume jQuery is already loaded on the page).