⚡ Ultra-fast Java screen capture — 500–2000 FPS zero-copy capture via DXGI Desktop Duplication.
FastScreen is a high-performance Java screen capture library and part of the FastJava ecosystem. It uses DXGI Desktop Duplication API for zero-copy, hardware-accelerated screen capture at 500–2000 FPS. Built for computer vision, gaming bots, screen recording, and real-time monitoring applications.
- Key Features
- Installation
- Quick Start
- Performance Benchmarks
- API Reference
- Documentation
- Platform Support
- License
- Related Projects
- 🚀 500–2000 FPS Capture — Zero-copy DXGI Desktop Duplication, GPU framebuffer direct access.
- ⚡ 10–17× Faster than
java.awt.Robot(8–16 ms vs. 50–100 ms per frame). - 🖥️ Hardware Acceleration — GPU → CPU without intermediate memory copy.
- 🚫 Zero GC Pressure — Reusable native buffers, nothing lands on the Java heap.
- 📦 Multiple Output Formats —
BufferedImage, raw RGBA pixels, or streaming callback. - 🖱️ Multi-Monitor Support — Target any display by index.
- 🔗 Powered by FastCore — Unified JNI loader for all FastJava modules.
- 📄 MIT Licensed — Free for commercial use.
import fastscreen.FastScreen;
public class Demo {
public static void main(String[] args) {
// Single screenshot
BufferedImage img = FastScreen.captureScreen();
// High-FPS stream
FastScreen.startStream(0, 0, 1920, 1080);
while (true) {
if (FastScreen.hasNewFrame()) {
byte[] frame = FastScreen.getNextFrame();
// process frame...
}
}
}
}Add the JitPack repository and the dependencies to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastScreen Library -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastScreen</artifactId>
<version>0.1.0</version>
</dependency>
<!-- FastCore (Required Native Loader) -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastCore</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:FastScreen:0.1.0'
implementation 'com.github.andrestubbe:FastCore:0.1.0'
}Download the latest JARs directly to add them to your classpath:
- 📦 fastscreen-0.1.0.jar (The Core Library)
- ⚙️ fastcore-0.1.0.jar (The Mandatory Native Loader)
Important
All JARs must be in your classpath for the native JNI calls to function correctly.
Run the included benchmark yourself:
cd examples/03-benchmark
mvn compile exec:java| Metric | FastScreen | java.awt.Robot |
Improvement |
|---|---|---|---|
| Single capture | 8–16 ms | 50–100 ms | 10–17× faster |
| Streaming FPS | 60–240 FPS | ~15 FPS | Up to 16× faster |
| GC pressure | None | High | Zero heap allocation |
| Method | Description |
|---|---|
captureScreen(Rectangle rect) |
BufferedImage screenshot of region |
captureRaw(int x, int y, int w, int h) |
Raw RGBA pixel array |
getPixelColor(int x, int y) |
Single pixel (very fast) |
| Method | Description |
|---|---|
startStream(int x, int y, int w, int h) |
Begin capture stream |
hasNewFrame() |
Check for new frame available |
getNextFrame() |
Get next frame (non-blocking) |
stopStream() |
Stop and release resources |
getStreamFPS() |
Current capture FPS |
| Method | Description |
|---|---|
getMonitorCount() |
Number of connected displays |
captureMonitor(int index) |
Capture a specific monitor |
- COMPILE.md: Full compilation guide (MSVC C++17 build chain + JNI Setup).
- REFERENCE.md: Full API descriptions and method reference.
- PHILOSOPHY.md: The engineering rationale for zero-allocation performance.
- ROADMAP.md: Future milestones and planned features.
| Platform | Status |
|---|---|
| Windows 10/11 | âś… Fully Supported |
| Linux | đźš§ Planned |
| macOS | đźš§ Planned |
MIT License — See LICENSE file for details.
- FastCore — Native Library Loader for Java
- FastRobot — High-FPS Screen Capture & Native Automation for Java
- FastImage — Ultra-Fast Native Image Processing for Java
- FastOCR — Ultra-Fast Native OCR for Java
Part of the FastJava Ecosystem — Making the JVM faster. ⚡
