⚡ Ultra-fast Java screen capture & automation library — 10-17× faster than java.awt.Robot
FastRobot is a high-performance Java automation library that replaces java.awt.Robot with a native Windows backend using DirectInput, GDI BitBlt, and DirectX DXGI. Built for low-latency automation, real-time screen capture, gaming bots, test automation, and computer vision applications.
Maven:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastrobot</artifactId>
<version>v2.1.0</version>
</dependency>Gradle:
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:fastrobot:v2.1.0'
}Direct Download (both required):
- fastrobot-2.1.0.jar — Main library with DLL
- fastcore-1.0.0.jar — JNI loader (required dependency)
# Run with both JARs
java -cp "fastrobot-2.1.0.jar:fastcore-1.0.0.jar:." YourAppimport fastrobot.FastRobot;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
FastRobot robot = new FastRobot();
// Fast screen capture - 10-17× faster than Robot
BufferedImage screen = robot.createScreenCapture(new Rectangle(0, 0, 1920, 1080));
// Instant mouse control
robot.mouseMove(500, 500);
robot.mousePress(FastRobot.BUTTON1);
robot.mouseRelease(FastRobot.BUTTON1);// Start 60fps-240fps streaming capture
robot.startScreenStream(0, 0, 1920, 1080);
while (true) {
if (robot.hasNewFrame()) {
int[] pixels = robot.getNextFrame(); // RGBA pixel array
double fps = robot.getStreamFPS();
System.out.println("Streaming at " + fps + " FPS");
}
}- 10-17× faster screen capture than
java.awt.Robot(60fps+ streaming) - 515× faster mouse click latency (DirectInput vs AWT event queue)
- 60fps+ streaming with DXGI hardware acceleration
- DirectInput mouse/keyboard — no OS throttling
- Zero GC pressure — native buffers, no Java2D overhead
- Powered by FastCore — unified JNI loader for all FastJava modules
- MIT licensed — free for commercial use
| Operation | java.awt.Robot | FastRobot | Speedup |
|---|---|---|---|
| Screen Capture (1920×1080) | ~138ms | ~8-16ms | 10-17× |
| Mouse Click Latency | ~0.24ms | ~0.0005ms | 515× |
| Streaming FPS | ~7fps | 60fps+ | 8-10× |
Measured on Windows 11, Intel Core i7, Java 17, 120Hz display
All examples are in the examples/ folder:
# Desktop Stream Demo - Live preview with 60 FPS
cd examples/00-basic-usage
mvn compile exec:javafastrobot/
├── src/main/java/fastrobot/ # Main API
│ └── FastRobot.java # Core automation class
├── examples/ # Runnable examples
│ └── 00-basic-usage/ # DesktopStreamDemo, PNGRecorder, Benchmark
├── native/ # C++ JNI source
│ ├── fastrobot.cpp # Native implementation
│ └── DXGICapture.cpp # DirectX capture
├── pom.xml # Maven configuration
├── README.md # This file
└── COMPILE.md # Build instructions
- JDK 17+
- Maven 3.9+
- Visual Studio 2019+ (for native DLL)
git clone https://github.com/andrestubbe/fastrobot.git
cd fastrobot
# Build Java + native DLL
mvn clean compile
# Create JAR with native libraries
mvn packagemouseMove(int x, int y)— Instant cursor positioningmousePress(int buttons)— Direct hardware button pressmouseRelease(int buttons)— Direct hardware button releasemouseClick(int buttons)— Press + releasesmoothMouseMove(int x, int y, int durationMs)— Human-like movement
keyPress(int keycode)— Zero-latency key presskeyRelease(int keycode)— Zero-latency key release
createScreenCapture(Rectangle rect)— BufferedImage capturegetPixelColor(int x, int y)— Single pixel (100× faster)
startScreenStream(int x, int y, int w, int h)— Begin 60fps+ capturegetNextFrame()— Get next frame (non-blocking)stopScreenStream()— Stop and cleanup
Java API (FastRobot.java)
↓ JNI (via FastCore)
Native Layer (C++/Win32)
├── DirectInput → Mouse/Keyboard
├── GDI BitBlt → Screen capture
└── DXGI Desktop Duplication → Streaming
↓
Windows OS (Hardware)
Powered by FastCore — Unified JNI loader for the FastJava ecosystem.
| Platform | Status |
|---|---|
| Windows 11 | ✅ Full support |
| Windows 10 | ✅ Full support |
| Linux | ❌ Not planned |
| macOS | ❌ Not planned |
- FastCore integration — Unified JNI loader
- Cleaner structure — Blueprint-based project layout
- Examples folder — Separated demos from core library
- DXGI Desktop Duplication API — hardware-accelerated streaming
- 60fps+ capture — matches monitor refresh rate
- C++ scaling — Hardware-accelerated frame scaling
- GDI BitBlt screen capture
- DirectInput mouse/keyboard
- Basic JNI wrapper
MIT License — free for commercial and private use. See LICENSE for details.
- FastCore — Unified JNI loader
- FastHotkey — Global hotkey library
- FastTouch — Multi-touch gestures
- FastClipboard — Clipboard access
- FastTheme — Display/theme monitor
- FastGraphics — GPU-accelerated graphics
- FastAI — AI/ML integration
- FastMath — SIMD math
- FastIO — High-performance I/O
Part of the FastJava Ecosystem — Making the JVM faster.