This Gist builds on https://gist.github.com/unconed/4370822 from @unconed.
Instead of the original method which writes to the browsers sandboxed filesystem here we use a websocket connection provided by websocketd to pipe image data to a short python script that writes out the .png files to disk.