uestccokey / EZFilter

A lightweight (<180KB), easy-to-extend Android filter and dynamic sticker framework for adding filters and stickers for camera, video, bitmap and view.(一个轻量级(<180KB)、易扩展的Android滤镜和动态贴纸框架,支持摄像头、视频、图片和视图添加滤镜和贴纸。)
MIT License
208 stars 57 forks source link
bitmap camera filter gpu-image offscreen-render opengl opengl-es shader video

Logo

EZFilter

A lightweight (<180KB), easy-to-extend Android filter and dynamic sticker framework for adding filters and stickers for camera, video, bitmap and view.

中文

Demo

Download

Screenshot

View加滤镜

Features

1.Support Camera, Camera2, Video, Bitmap and View add filters

2.Support Camera, Camera2, Video, Bitmap and View add dynamic stickers

3.Support recording video

4.Support screenshot

5.Support offscreen rendering

Sample

you can use EZFilter.input(xxx).addFilter(filter).into(view) to add filter and display.

EZFilter.input(bitmap)
        .addFilter(filter)
        .into(view);
EZFilter.input(video)
        .setLoop(true)
        .setVolume(0.5f)
        .addFilter(filter)
        .into(view);
EZFilter.input(camera)
        .addFilter(filter)
        .into(view);
EZFilter.input(camera2)
        .addFilter(filter)
        .into(view);
EZFilter.input(glview)
        .addFilter(filter)
        .into(view);

After calling the into method, you will get a RenderPipeline object, then you can use it for screenshots.

mPipeline.output(new BitmapOutput.BitmapOutputCallback() {
        @Override
        public void bitmapOutput(Bitmap bitmap){
        }
    }, true);
view.requestRender();
    // or
mPipeline.output(new BitmapOutput.BitmapOutputCallback() {
        @Override
        public void bitmapOutput(Bitmap bitmap){
        }
    }, width, height, true);
view.requestRender();

Other functions, such as recording videos, adding dynamic stickers, particle effects, etc., please refer to demo.