title: Getting pixel information from the screen quickly
body: <p>I am writing an application which needs to get the colors of pixels on the screen to run different automated tests.</p>
  
  <p>(Yes, I know of the preexisting automated testing libraries. No, I can't use them.)</p>
  
  <p>Currently, I'm writing in Java and the program mostly does this:</p>
  
  <pre><code>Robot r = new Robot();
  for (int i = 0; i &lt; 10; i++)
      for (int j = 0; j &lt; 10; j++)
          r.getPixelColor(i*20, j*20);
  </code></pre>
  
  <p>The problem with this is that it's really slow. It takes about a second to do that scan. (10ms per pixel.) There are two problems: (1) I would like it to be fast, and (2) within a second, the screen has changed already. For various reasons, the screen only updates once every half second, so the only issue that matters is (1).</p>
  
  <p>Is there any way to get pixel color information more quickly? If there are no Java libraries to do this, I'm happy to hear about C (or other) ways of doing this.</p>