use stripped down getpixel function for speed