Processing pixels in real time on canvas