See blog post for details: http://hungry-media.com/2010/09/html5canvas-fun-extracting-colors-from-images/