Skip to content

Repository files navigation

FastScreen 0.1.0 [ALPHA-2026-06-14] — High-Performance Native Screen Capture for Java

Status License: MIT Java Platform JitPack

⚡ 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.

FastScreen Showcase


Table of Contents


Key Features

  • 🚀 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.

Quick Start

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...
            }
        }
    }
}

Installation

Option 1: Maven (Recommended)

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>

Option 2: Gradle (via JitPack)

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.andrestubbe:FastScreen:0.1.0'
    implementation 'com.github.andrestubbe:FastCore:0.1.0'
}

Option 3: Direct Download (No Build Tool)

Download the latest JARs directly to add them to your classpath:

  1. 📦 fastscreen-0.1.0.jar (The Core Library)
  2. ⚙️ 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.


Performance Benchmarks

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

API Reference

Screen Capture

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)

Streaming (High-FPS)

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

Monitor Selection

Method Description
getMonitorCount() Number of connected displays
captureMonitor(int index) Capture a specific monitor

Documentation

  • 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 Support

Platform Status
Windows 10/11 âś… Fully Supported
Linux đźš§ Planned
macOS đźš§ Planned

License

MIT License — See LICENSE file for details.


Related Projects

  • 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. ⚡

About

🖼️ High‑performance screen capture for Java — 500–2000 FPS zero‑copy DXGI duplication, GPU‑accelerated streaming, and ultra‑low‑latency pixel access for vision and automation pipelines.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages