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