The code I used in my article about the canvas element in the series HTML5 now for Web & PHP magazine