Another option here is to track the pixels that are drawn on a canvas, rather than proxying the canvas calls and re-implementing the stroking logic. PixelSampler.js has some tools to help with this.