8

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.

I've tried making screenshots with robot.createScreenCapture() but it takes +- 45ms to run that line which causes the LEDs to change color way too late.

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?

This is the method I currently use to get a screenshot:

Robot robot = new Robot();
Rectangle area = new Rectangle(0, 0, this.screenSize.width, this.screenSize.height);
BufferedImage bufferedImage = robot.createScreenCapture(area); //Slow line
Jawa
  • 2,336
  • 6
  • 34
  • 39

1 Answers1

-1

Use method getPixelColor() on robot

Hapon
  • 1
  • I've tried that but it has only proven to be slower than `createScreenCapture()` since I have to get the pixel colors of a lot of pixels – Martin Drost Sep 17 '15 at 17:08