RepositoryC
WY

wysaid/android-gpuimage-plus

Android Image & Camera Filters Based on OpenGL.

1.9kstars
473forks
123issues
8views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: cge

#1 Repository of the month

1
TINIX TRENDING·Topic: jni

#1 Repository of the month

1
TINIX TRENDING·Topic: filter

#1 Repository of the month

Android-GPUImage-Plus

Contributors Pull Requests Welcome

A C++ & Java library for Image/Camera/Video filters. PRs are welcomed.

New Features

v3.x adds CameraX support (CameraXProvider) and a unified zoom API (ICameraProvider.setZoomRatio).

screenshots screenshots

Gradle dependency

allprojects {
    repositories {
        maven {
            // Use github hosted maven repo for now.
            // Repo url: https://github.com/wysaid/android-gpuimage-plus-maven
            url 'https://maven.wysaid.org/'
        }
    }
}

// Choose only one of them
dependencies {
    // Page size: 4KB (default)
    // Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
    // Full-featured with FFmpeg bundled
    implementation 'org.wysaid:gpuimage-plus:3.1.2'

    // Page size: 16KB
    // Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
    // Full-featured with FFmpeg bundled
    implementation 'org.wysaid:gpuimage-plus:3.1.2-16k'

    // Page size: 4KB (default)
    // Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
    // Image-only version (no video features or FFmpeg)
    implementation 'org.wysaid:gpuimage-plus:3.1.2-min'

    // Page size: 16KB
    // Architectures: armeabi-v7a, arm64-v8a, x86, x86_64
    // Image-only version (no video features or FFmpeg)
    implementation 'org.wysaid:gpuimage-plus:3.1.2-16k-min'
}

To compile other versions of ffmpeg, see: https://github.com/wysaid/FFmpeg-Android.git

Build

Quick start with Android Studio:

  1. Add usingCMakeCompile=true to local.properties
  2. Open the project in Android Studio
  3. Wait for NDK/CMake initialization
  4. Build and run

For detailed build instructions, configuration options, and alternative build methods (VS Code, command line, ndk-build), see docs/build.md.

Precompiled libraries: android-gpuimage-plus-libs
iOS version: ios-gpuimage-plus

Manual

1. Usage

Apply a filter with a rule string:

Bitmap srcImage = ...;

// HSL Adjust (hue: 0.02, saturation: -0.31, luminance: -0.17)
String ruleString = "@adjust hsl 0.02 -0.31 -0.17";

Bitmap dstImage = CGENativeLibrary.filterImage_MultipleEffects(srcImage, ruleString, 1.0f);

// Save result
ImageUtil.saveBitmap(dstImage);

2. Custom Shader Filter

2.1 Writing a Filter

Custom filters inherit from CGEImageFilterInterface:

// A simple color reversal filter
class MyCustomFilter : public CGE::CGEImageFilterInterface
{
public:
    bool init()
    {
        CGEConstString fragmentShaderString = CGE_SHADER_STRING_PRECISION_H
        (
        varying vec2 textureCoordinate;
        uniform sampler2D inputImageTexture;

        void main()
        {
            vec4 src = texture2D(inputImageTexture, textureCoordinate);
            src.rgb = 1.0 - src.rgb;  // Reverse all channels
            gl_FragColor = src;
        }
        );

        return m_program.initWithShaderStrings(g_vshDefaultWithoutTexCoord, fragmentShaderString);
    }
};

See customFilter_N.cpp for a complete example.

2.2 Running a Custom Filter

In C++:

// Assumes GL context exists
CGEImageHandlerAndroid handler;
auto* customFilter = new MyCustomFilter();

customFilter->init();
handler.initWithBitmap(env, bitmap);
handler.addImageFilter(customFilter);  // Handler takes ownership

handler.processingFilters();
jobject resultBitmap = handler.getResultBitmap(env);

If no GL context exists, use CGESharedGLContext.

In Java:

Use CGENativeLibrary.cgeFilterImageWithCustomFilter or CGEImageHandler directly.

3. Filter Rule Strings

Filter effects are defined by text-based rule strings. See docs/filter-rules.md for complete syntax reference.

Quick example:

// Chain multiple filters with @ separator
String filter = "@curve RGB (0,0) (128,150) (255,255) " +
                "@adjust hsl 0.02 -0.31 -0.17 " +
                "@blend overlay texture.jpg 80";

4. Key Classes & Threading

ClassPurpose
CGENativeLibraryMain entry — static filter methods
CGEImageHandlerImage handler wrapper
CGEFrameRendererReal-time camera/video renderer
CGEFrameRecorderVideo recording (requires FFmpeg)

Important: GL operations must run on the GL thread:

glSurfaceView.queueEvent(() -> {
    // Your GL operations here
});

Documentation

Tool

CGE-Tools — open-source desktop companion for creating and previewing CGE filter rules (macOS / Linux / Windows). Latest release: v2.0.0.

Tool

Contributors

This project is built with help from the open-source community. Contributions of code, documentation, tests, bug reports, and reviews are all welcome.

Contributors

License

MIT License

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
opencv/opencv

Open Source Computer Vision Library

91.8k
Nov 30, 2026
RepositoryRust
alacritty/alacritty

A cross-platform, OpenGL terminal emulator.

66.4k
Dec 1, 2026
RepositoryC
raysan5/raylib

A simple and easy-to-use library to enjoy videogames programming

35.8k
Nov 25, 2026
RepositoryPython
kovidgoyal/kitty

If you live in the terminal, kitty is made for you! Cross-platform, fast, feature-rich, GPU based.

36.0k
Dec 2, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryTypeScript
firecrawl/firecrawl

Firecrawl is the knowledge infrastructure to make your agents smarter. It connects your agents to the web, and to Alexandria, our library of everything else.

215.1k
Dec 2, 2026
RepositoryShell
ohmyzsh/ohmyzsh

🙃 A delightful, community-driven framework for managing your zsh configuration. Built by 2,600+ contributors, with hundreds of plugins (git, rails, laravel, node, python, docker, kubectl, aws, and more), themes to spice up your terminal, and automatic updates to keep your command line feeling like home.

191.0k
Nov 29, 2026
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026