Dithering Algorithms HTML5