now reading from imagecanvas pixel array instead of imagedata