title: Fast screen capture Java
body: <p>I'm trying to create Ambilight using some LED strips connected to a Raspberry Pi running Raspbian. I'm building an application with Java which has to read out the colors of the pixels on all sides of the screen so I can use those to color the LEDs behind the screen.</p>
  
  <p>I've tried making screenshots with <code>robot.createScreenCapture()</code> but it takes +- 45ms to run that line which causes the LEDs to change color way too late.</p>
  
  <p>Does anyone have an idea of how to create a screenshot faster or how to get the pixel colors another way which reduces the ms?</p>
  
  <p>This is the method I currently use to get a screenshot:</p>
  
  <pre><code>Robot robot = new Robot();
  Rectangle area = new Rectangle(0, 0, this.screenSize.width, this.screenSize.height);
  BufferedImage bufferedImage = robot.createScreenCapture(area); //Slow line
  </code></pre>