The script is used in my newest chrome app
https://chrome.google.com/webstore/developer/detail/bomkcodcgmbjjhogdjophonfhgpegoni/
Site:
http://codestrix.co.cc/pixels/
The above script is a good to get stated with HTML5 canvas.
Much of it is named so as to be self explanatory but any doubts you are more than welcome to post it here.