You can get all raw <canvas> pixel values by calling getImageData ()
https://developer.mozilla.org/en-US/docs/DOM/CanvasRenderingContext2D#getImageData%28%29
Then you look at that pixel data in a Javascript loop and count all the pixels that don't have a background color.
Percentage of Canvas Filled
completed = filledInPixels / (canvas.width * canvas.height)
Note that the call to getImageData() very slow, and you can only call it just in a second.
source share