FastGrab 0.1.0 [ALPHA] β Ultra-Fast Uncompressed Screen Capture CLI & Global Hotkey Daemon for Java
β‘ Bit-perfect uncompressed screen grabs in under 1 millisecond. Direct DirectX 11 DXGI GPU capture, zero GC pressure, and native system-wide hotkeys.
FastGrab is a minimalist, ultra-responsive replacement for bloated screenshot utilities like ShareX and Windows Snipping Tool. Instead of freezing the desktop and forcing heavy PNG compression, FastGrab streams raw uncompressed BMP / BGRA byte buffers straight from the GPU frame buffer to NVMe storage.
FastGrab.batCaptures the entire desktop at hardware resolution and writes a bit-perfect uncompressed .bmp into grabs/.
FastGrab.bat --daemon --hotkey F10Runs quietly in the background. Pressing [F10] anywhere in Windows triggers an instant snapshot without UI lag or focus interruption.
import fastscreen.FastScreen;
import fastgrab.FastBmpWriter;
public class Demo {
public static void main(String[] args) throws Exception {
FastScreen screen = new FastScreen();
try {
int[] pixels = screen.captureRaw(0, 0, 1920, 1080);
FastBmpWriter.writeBmp("instant_grab.bmp", 1920, 1080, pixels);
} finally {
screen.dispose();
}
}
}- Why FastGrab?
- Key Features
- Real-World Use Cases
- Architecture & Pipeline
- Performance Benchmarks
- Installation
- Documentation
- Platform Support
- License
- Related Projects
Traditional capture tools are poorly suited for latency-critical tasks, high-frequency analysis, and bit-accurate image verification:
- Sluggish UI & Desktop Freezes: Snipping Tool and ShareX interrupt desktop interaction, causing UI stutter and focus drops.
- Forced CPU Compression Overhead: Enforcing PNG/JPEG encoding burns 20β100 ms of CPU time per frame and creates compression artifacts.
- Severe GC Stalls: Legacy Java capture tools allocate tens of megabytes per frame on the JVM heap.
FastGrab bypasses these limitations:
- Direct DXGI Desktop Duplication: Raw GPU framebuffer extraction in <1 ms via
FastScreen. - Bit-Perfect 100% Raw BMP: Lossless uncompressed files instantly openable in any viewer or editor.
- Global Low-Latency Hooks: Instantaneous event response via
FastHotkey. - Zero JVM GC Allocations: Zero-copy off-heap memory path straight to disk.
- β‘ Instant Capture Throughput β Captures and commits full desktop frames in milliseconds.
- π― Bit-Perfect Quality β 100% uncompressed raw BGRA/ARGB data without lossy artifacts.
- β¨οΈ Global Native Hotkeys β Background daemon mode listening for
F1βF12orPrintScreen. - π Direct-to-Disk DMA β Streamlined Little-Endian BMP serialization bypassing OS memory bloat.
- π FastJava Synergy β Powered by
FastScreen,FastHotkey, andFastCore.
- β‘ Zero-Lag Screenshot Hotkey Daemon: Replace bloated screenshot utilities (ShareX, Windows Snipping Tool) with a background process that commits full-resolution desktop captures in <6 ms without UI pauses or window flashes.
- π― Bit-Exact Visual Regression & UI Testing: Capture pristine, 100% uncompressed frames during automated UI / rendering test suites (e.g., Selenium, JavaFX, OpenGL, Vulkan) where PNG compression artifacts or color subsampling would cause false positive diffs.
- ποΈ High-Speed Gameplay & Event Bursting: Burst-capture 5β60 consecutive uncompressed frames (
--burst 10) at full monitor refresh rates during rapid in-game action, physics anomalies, or micro-stutters. - π€ Dataset Generation for Vision & OCR Pipelines: Rapidly collect hundreds of raw screen patches per second without GPU/CPU encoding bottlenecks for training OCR, layout parsing, or object detection models.
- π Financial & High-Frequency Trading Telemetry: Archive pixel-accurate order book states, charts, and millisecond ticker snapshots without introducing thread latency to execution algorithms.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Windows OS Global Hotkey β
β (FastHotkey) β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β Instant Key Event (<0.1ms)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastGrab Daemon Engine β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β Request Frame (<1ms)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastScreen β
β (DirectX 11 DXGI GPU Desktop Duplication) β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β Zero-Copy Off-Heap BGRA Buffer
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FastBmpWriter β
β (54-Byte Top-Down DIB Header) β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β Direct NIO Channel Write
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Fast Storage / NVMe SSD (.bmp) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Measured on official JMH benchmark suite (run-benchmark.bat):
Benchmark Mode Cnt Score Error Units
Benchmark.benchmarkFastGrabBmpWriter thrpt 3 0.221 ops/ms
Note
Environment & Setup: Measured on an 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (4C/8T), Windows 11 Home, OpenJDK 21 LTS. Writing uncompressed 800Γ600 full 32-bit frames directly to disk achieves >220 full frames / sec with zero JVM heap garbage allocations.
FastGrab provides both high-speed Java methods and a standalone CLI tool:
| Class | Method | Return Type | Description |
|---|---|---|---|
FastBmpWriter |
writeBmp(String path, int w, int h, int[] pixels) |
void |
Writes 32-bit ARGB/BGRA pixel array directly to uncompressed Windows BMP file (top-down DIB). |
FastBmpWriter |
writeDirectBgra(String path, int w, int h, ByteBuffer buffer) |
void |
Zero-Copy: Streams direct off-heap native buffer straight to disk via NIO FileChannel. |
| Switch | Long Option | Argument | Description | Default |
|---|---|---|---|---|
-d |
--daemon |
- | Runs continuously in background listening for global hotkey | false |
-k |
--hotkey |
<KEY> |
Hotkey keycode name (F1βF12, PRINTSCREEN) |
F10 |
-o |
--out |
<path.bmp> |
Custom output file path for single capture | grab_YYYYMMDD_HHMMSS_SSS.bmp |
-r |
--rect |
<x,y,w,h> |
Explicit capture region coordinates | Full primary screen |
-b |
--burst |
<count> |
Consecutive frame burst count | 1 |
-h |
--help |
- | Prints usage instructions and switches | - |
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>
<!-- FastGrab Engine -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastGrab</artifactId>
<version>0.1.0</version>
</dependency>
<!-- Underlying Hardware Engines -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>FastScreen</artifactId>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fasthotkey</artifactId>
<version>0.1.0</version>
</dependency>
<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:FastGrab:0.1.0'
implementation 'com.github.andrestubbe:FastScreen:0.1.2'
implementation 'com.github.andrestubbe:fasthotkey:0.1.0'
implementation 'com.github.andrestubbe:FastCore:0.1.0'
}Download the latest pre-compiled JARs directly to add them to your project's classpath or use the CLI directly:
- πΈ FastGrab-0.1.0.jar (The CLI & Capture Engine)
- π₯οΈ FastScreen-0.1.2.jar (DirectX 11 DXGI Desktop Capture)
- β¨οΈ FastHotkey-0.1.0.jar (Low-Latency Win32 Hotkeys)
- βοΈ FastCore-0.1.0.jar (Mandatory Native Library Loader)
Important
FastGrab requires FastScreen (and its native DLL), FastHotkey, and FastCore on the classpath to run.
- PHILOSOPHY.md: The engineering rationale for uncompressed zero-latency captures.
- REFERENCE.md: Complete CLI switches and Java API reference.
- CHANGELOG.md: Full release history and version notes.
- ROADMAP.md: Upcoming features, 60+ FPS video streaming, and ecosystem milestones.
| Platform | Status |
|---|---|
| Windows 10/11 (x64) | β Fully Supported (DirectX 11 DXGI + Win32 Hooks) |
| Linux | π§ Planned |
| macOS | π§ Planned |
MIT License β See LICENSE for details.
- FastScreen β Ultra-Fast DirectX Screen Capture Engine
- FastCamera β Hardware-Accelerated Native Camera Capture & Streaming
- FastHotkey β Low-Latency Global System Hotkeys
- FastImage β SIMD-Accelerated Off-Heap Image Engine
- FastCore β Native Library Loader for Java
Part of the FastJava Ecosystem β Making the JVM faster. β‘