python find pixel of color on screen code example
Example: python get pixel color from screen
I had this same exact problem, and solved it (in Java, in C#). The main idea behind the solution is GetPixel from screen is slow, and you can't fix that. But as you need some pixels, you can get a bunch of them all at once.
The time that it took to get 64 pixels was 98 times faster.