Javascript + HTML5 app to detect dominant colors in an image