let's call getImageData just the one time for a bit of a performance improvement