isolated GetPixel function