Ultra-fast native image processing using AVX2/SSE4.1 kernels and zero-GC memory management.
FastImage ist eine ultra‑schnelle, native‑beschleunigte Image‑Processing‑Engine für Java, gebaut für das FastJava‑Ecosystem. Es kombiniert AVX/SSE SIMD, off‑heap Storage, zero‑copy Pipelines und eine fluent API, um typische BufferedImage‑Operationen 10–50× schneller auszuführen — ohne GC‑Pressure, ohne Pixel‑Loops, ohne JVM‑Overhead.
// Quick Start — SIMD-Accelerated Filtering
import fastimage.FastImage;
public class Demo {
public static void main(String[] args) {
FastImage img = FastImage.load("input.jpg");
img.adjustContrast(1.2f)
.blurStack(15.0f)
.grayscale();
img.save("output.png");
img.dispose(); // Free native memory
}
}- Key Features
- Performance
- Installation
- Try the Demo
- API Reference
- Platform Support
- Building from Source
- License
- Related Projects
- 🚀 SIMD Acceleration — Hand-optimized C++ kernels using AVX2 and SSE4.1 vector instructions.
- 🧠 Zero-GC Overhead — Pixels are stored in off-heap memory, preventing GC pauses during heavy manipulation.
- 🌀 Advanced Blur Suite — Real-time Gaussian, Stack (iOS-style), and Kawase blurs.
- 🛡️ Fail-Safe JNI — Robust error handling with
FastImageExceptionand native handle validation. - 🔄 Fast Conversion — Optimized bit-copying between
BufferedImageand native memory.
FastImage utilizes the full power of your CPU, outperforming standard Java2D loops by orders of magnitude:
| Operation | Java2D (BufferedImage) | FastImage (SIMD) | Speedup |
|---|---|---|---|
| Brightness | ~48.6 ms/op | ~1.5 ms/op | 32x |
| Gaussian Blur (r10) | ~1100.0 ms/op | ~170.4 ms/op | 6.5x |
| Grayscale | ~20.0 ms/op | ~1.3 ms/op | 15x |
Tested on: 1920x1080 (1080p) ARGB Image on Intel i7-12700K.
FastJava modules require two dependencies: the module itself, and FastCore (which handles the native library extraction).
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastimage</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:fastimage:0.1.0'
implementation 'com.github.andrestubbe:fastcore:0.1.0'
}Download the latest JARs directly from the releases:
- Clone this repository:
git clone https://github.com/andrestubbe/FastImage.git - Run the automated showcase:
.\run-demo.bat
Includes the interactive Visual Editor and the Blur Gallery.
| Method | Description |
|---|---|
void grayscale() |
Converts image to luminance-weighted grayscale via SIMD. |
void adjustBrightness(f) |
Scales RGB values with saturation clamping. |
void adjustContrast(f) |
Adjusts image contrast around the midpoint. |
void blurGaussian(r) |
High-quality Gaussian blur approximation ($O(N)$). |
void blurStack(r) |
Extremely fast separable weighted blur. |
void resize(w, h) |
Bilinear resizing using native kernels. |
| Architecture | Instruction Set | OS |
|---|---|---|
| x64 | AVX2 (Runtime Dispatch) | Windows 10/11 |
| x64 | SSE4.1 (Fallback) | Windows 10/11 |
For detailed instructions on compiling the C++ JNI code and building the Maven FatJAR, see COMPILE.md.
MIT License — See LICENSE file for details.
- FastCore — Native Library Loader
- FastTheme — Native Window Styling
- FastGraphics — Hardware-accelerated 2D Rendering
Made with ⚡ by Andre Stubbe