I am trying to create Ambilight using some LED strips connected to Raspberry Pi running on Raspbian. I am creating a Java application that needs to read pixel colors from all sides of the screen, so I can use them for color LEDs behind the screen.
I tried to take screenshots with robot.createScreenCapture() , but it takes + - 45 ms to execute this line, which causes the LEDs to change color too late.
Does anyone have an idea on how to take a screenshot faster or how to get pixel colors in another way that reduces ms?
This is the method I'm currently using to take a screenshot:
Robot robot = new Robot(); Rectangle area = new Rectangle(0, 0, this.screenSize.width, this.screenSize.height); BufferedImage bufferedImage = robot.createScreenCapture(area);
java performance screen capture
Martin Drost
source share