AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

Overview

PhotoFiltersSDK

License Android Arsenal

PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

Library supports OS on API 15 and above.

PhotoFilters gif

Features

PhotoFiltersSDK processes filter on any Image within fraction of second since processing logic is in NDK. At present following image filters are included:

Library also comes with inbuilt Sample Filters (Refer SampleFitlers.java). Implementation is straightforward:

Filter fooFilter = SampleFilters.getBlueMessFilter();
Bitmap outputImage = fooFilter.processFilter(inputImage);

Implementation

Adding Dependency

Simply add Dependency on artifact in your build.gradle :

dependencies {
    compile 'com.github.zomato:androidphotofilters:1.0.2'
    ...

OR

Copy|Paste photofilterssdk from the repo to your project and include photofiltersdk in your settings.gradle like this :

include ':photofilterssdk'

Add dependency in your build.gradle :

compile project(':photofilterssdk')

Usage

Load native library in your activity :

public class MainActivity extends AppCompatActivity {
    static
    {
        System.loadLibrary("NativeImageProcessor");
    }
    ...

then

Filter myFilter = new Filter();
myFilter.addSubFilter(new BrightnessSubFilter(30));
myFilter.addSubFilter(new ContrastSubFilter(1.1f));
Bitmap outputImage = myFilter.processFilter(inputImage);

Above code snippet will give you outputImage with increased brightness and contrast. You can further refer example project.

Documentation

Although there are few inbuilt filters already present, you may want to create and customize one specific to your need and show your creativity. For that you would require to know how all the Subfilters can be used. Let me take you through all of them.

ToneCurveSubfilter

This is most awesome filter present in this library which differentiates PhotoFiltersSDK from other image processing libraries out there. ToneCurveSubFilter applies the changed RGB Channel curve to create effect on image.

CurveDialog

Here is the code snippet the apply the above RGB curve on an image :

Filter myFilter = new Filter();
Point[] rgbKnots;
rgbKnots = new Point[3];
rgbKnots[0] = new Point(0, 0);
rgbKnots[1] = new Point(175, 139);
rgbKnots[2] = new Point(255, 255);
       
myFilter.addSubFilter(new ToneCurveSubfilter(rgbKnots, null, null, null));
Bitmap outputImage = myFilter.processFilter(inputImage);

The results are nearly same as we would see in photoshop and other tools. We can also specify knots for Red, Green and Blue channels (in the ToneCurveSubfilter's constructor).

SaturationSubfilter

This fitler can be used to tweak color saturation of an image. Here is the example :

Filter myFilter = new Filter();
myFilter.addSubFilter(new SaturationSubfilter(1.3f));
Bitmap outputImage = myFilter.processFilter(inputImage);

SaturationSubfilter takes float as an argument and has no effect for value 1.

ColorOverlaySubfilter

Increases the specified red, green and blue values for each pixel in an image.

Filter myFilter = new Filter();
myFilter.addSubFilter(new ColorOverlaySubfilter(100, .2f, .2f, .0f));
Bitmap outputImage = myFilter.processFilter(inputImage);

ContrastSubfilter

To change the contrast levels of an image use this filter :

Filter myFilter = new Filter();
myFilter.addSubFilter(new ContrastSubfilter(1.2f));
Bitmap outputImage = myFilter.processFilter(inputImage);

ContrastSubfilter takes float as an argument where value 1 has no effect on the image.

BrightnessSubfilter

As the name suggest, this filter is used for changing brightness levels :

Filter myFilter = new Filter();
myFilter.addSubFilter(new BrightnessSubfilter(30));
Bitmap ouputImage = myFilter.processFilter(inputImage);

BrightnessSubfilter takes int as an argument where value 0 has no effect. Negative values can be used to decrease brightness of the image.

VignetteSubfilter

This filter can be used to put vignette effect on the image.

Filter myFilter = new Filter();
myFilter.addSubFilter(new VignetteSubfilter(context, 100));
Bitmap outputImage = myFilter.processFilter(inputImage);

VignetteSubfilter takes int as an argument whoes value ranges from 0-255, which defines intesity of the vignette effect.

Proguard

If you are using proguard, consider adding the following to your proguard rules:

-keep class com.zomato.photofilters.** {*;}
-keepclassmembers  class com.zomato.photofilters.** {*;}

License

This library falls under Apache v2

Comments
  • Correct subfilters' class names

    Correct subfilters' class names

    In my Mac (FS is HFS+), the filename BrightnessSubFilter.java but class name is BrightnessSubfilter that made compiling failure, according to the base class called SubFiler, I correct all sub-filters naming convention.

    I also found current master branch can't pass compiling because quality check tipping there have an unused import issue, I fix that too.

    In addition, I update gradle version to 2.1.2, and fix a warning that Android Studio suggests.

    I also refactor ThumbnailsAdapter, removing NineOldAndroid (there is no need when SDK version above 14).

    opened by jasl 12
  • IllegalStateException

    IllegalStateException

    I'm not sure what's the issue here. It just throws IllegalStateException at the last line (Where I'm saving the output to Bitmap output). I followed all the proper steps. Can't figure out the problem.

    Bitmap output =filter.processFilter(oldBitmap);

    opened by sagarlakhia 8
  • Black & White and Sepia Tone

    Black & White and Sepia Tone

    Hi,

    Thanks for library. Its really great. I am bad at image skills. Can you please provide b&w and sepia effect? I cant figure out to how to do it with given sub filters.

    Thanks

    opened by emreaktrk 4
  • java.lang.IllegalArgumentException: The Path cannot loop back on itself. in ToneCurveSubfilter

    java.lang.IllegalArgumentException: The Path cannot loop back on itself. in ToneCurveSubfilter

    I added the following points in the ToneCurveSubfilter under the rgb part.

    Filter myFilter = new Filter(); Point[] rgbKnots; rgbKnots = new Point[5]; rgbKnots[0] = new Point(0, 0); rgbKnots[1] = new Point(51, 152); rgbKnots[2] = new Point(73, 172); rgbKnots[3] = new Point(204, 219); rgbKnots[4] = new Point(255, 255); myFilter.addSubFilter(new ToneCurveSubfilter(rgbKnots, null, null, null)); Bitmap outputImage = myFilter.process(inputImage);

    The app crashes saying

    java.lang.IllegalArgumentException: The Path cannot loop back on itself. at android.view.animation.PathInterpolator.initPath(PathInterpolator.java:181) at android.view.animation.PathInterpolator.(PathInterpolator.java:61) at com.zomato.photofilters.geometry.BezierSpline.getOutputPointsForNewerDevices(BezierSpline.java:61)

    I am new to android image processing and am not able to resolve the issue. Please help

    opened by madhavbansal23 4
  • Release new version

    Release new version

    With changes in the API from PR #35, we'll have to release a new version of the library.

    @varunest How is the release uploaded right now? AFAIK it is from your account only. Is there a way to share access to release with more team members?

    opened by ylogx 3
  • Recyclerview Filtered Image Stretched.

    Recyclerview Filtered Image Stretched.

    Hi, this is very good library for filters and i use it, but when i select any photo and it reflect to recyclerview's item which is shows how image looks like after selecting this filter, that images stretched, i used center crop in item imageview but not worked.

    Anyone who solved this issue please give me suggestion or solution for it.

    Thanks

    opened by RB4915 2
  • PMEM_CACHE_FLUSH error

    PMEM_CACHE_FLUSH error

    when I apply a filter on bitmap, android studio shows infinite messages like this :

    W/QualcommCameraHardware7225a: MemoryCacheFlush : fd 73 size 155648 PMEM_CACHE_FLUSH error Invalid argument (22)

    Is there any problem with this??

    opened by noorzaie 2
  • Update build configuration

    Update build configuration

    1. Use ndk-build for compiling native files everytime compile is issued.
    2. Removed .so files which were earlier kept precompiled
    3. Updated gradle and build tools version
    4. Removed quality gradle script as it was causing issue in compiling.
    opened by varunest 1
  • Api modifications

    Api modifications

    Added a few changes which were needed in one of my projects.

    • class names are renamed to match the file names. I believe #5 aims to solve this too. But it was not merged and I went ahead and made these changes in my branch anyway.

    • have modified the API of Filter so it adds a list of SubFilter and returns a new list containing the applied SubFilters.

    • exposed current applied levels in Brightness, Contrast and Saturation Filters.

    Kindly review and consider pulling.

    opened by archie94 1
  • Added proguard rules allowing consumers of the sdk to minify their app.

    Added proguard rules allowing consumers of the sdk to minify their app.

    I consume this project through one of it's forks, which supply it through gradle/maven. When doing this, we need proguard rules in order to use minifyEnabled.

    I've added the rules in the example project, as well as in your readme, just above the license (tested in 2 projects, one in production at this time)..

    I hope this can help future consumers of your work!

    This is my first contribution here. Please let me know if there's something I should change before you can approve this.

    opened by hauthorn 1
  • Typo, Incorrect Documentation

    Typo, Incorrect Documentation

    The VignetteSubFilter class is spelled wrong ("SubFitler"), has different capitalization than in documentation, and takes an extra parameter (Context) not described in documentation.

    opened by rneogy 1
  • missing util package

    missing util package

    Firstly, I installed the dependency of zomato in gardle.build file

    implementation 'com.github.zomato:androidphotofilters:1.0.2'
    

    And it is installed successfully but when I try to get ThumbnailItem from com.zomato.photofilters.util.ThumbnailItem I found that the utiil package is missed.

    opened by Halieeim 0
  • libNativeImageProcessor not found

    libNativeImageProcessor not found

    dlopen failed: library "libNativeImageProcessor.so" not found

    After writing this also

    static { System.loadLibrary("NativeImageProcessor"); }

    Please resolve asap

    opened by trrev2021 0
  • java.lang.NullPointerException: Attempt to read from field 'float com.zomato.photofilters.geometry.Point.x' on a null object reference

    java.lang.NullPointerException: Attempt to read from field 'float com.zomato.photofilters.geometry.Point.x' on a null object reference

    E/InputEventReceiver: Exception dispatching input event. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mobilix.photoeditor, PID: 6354 java.lang.NullPointerException: Attempt to read from field 'float com.zomato.photofilters.geometry.Point.x' on a null object reference at com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubFilter.sortPointsOnXAxis(ToneCurveSubFilter.java:93) at com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubFilter.process(ToneCurveSubFilter.java:64) at com.zomato.photofilters.imageprocessors.Filter.processFilter(Filter.java:115) at editor.toolsmanager.FilterTools$FilterController.update(FilterTools.java:266) at editor.toolsmanager.FilterTools$2.onProgressChanged(FilterTools.java:181) at android.widget.SeekBar.onProgressRefresh(SeekBar.java:98)

    opened by EAStudios 0
  • Crash on System.loadLibrary(

    Crash on System.loadLibrary("NativeImageProcessor"); on First launch

    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file ""],nativeLibraryDirectories=[oXNkeS75H_GZt21u1A6laQ==/lib/arm, oXNkeS75H_GZt21u1A6laQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]] couldn't find "libNativeImageProcessor.so"
    
    opened by Bukhari386 0
  • Trying to get in touch regarding a security issue

    Trying to get in touch regarding a security issue

    Hey there!

    I'd like to report a security issue but cannot find contact instructions on your repository.

    If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

    Thank you for your consideration, and I look forward to hearing from you!

    (cc @huntr-helper)

    opened by JamieSlome 0
Releases(v1.0.2)
Owner
Zomato
Zomato
Convert video to GIF. Simple and fast.

Convert video to GIF. Simple and fast.

tasy5kg 24 Nov 26, 2022
Cache support for any video player with help of single line

Video cache support for Android Table of Content Why AndroidVideoCache? Features Get started Recipes Disk cache limit Listen caching progress Providin

Alexey Danilov 5.1k Dec 26, 2022
A Java API to read, write and create MP4 files

Build status: Current central released version 1.x branch: Current central released version 2.x branch: Java MP4 Parser A Java API to read, write and

Sebastian Annies 2.4k Apr 2, 2021
script(s) to build ffmpeg for android, including support for RTMP (and OpenSSL)

android-ffmpeg-with-rtmp This repository contains script(s) to build ffmpeg for android with RTMP (and OpenSSL) support. Instructions Install the Andr

cine.io 234 Dec 28, 2022
Script and Instructions for building FFmpeg for Android

FFmpeg-Android Herein lies scripts and instructions for compiling FFmpeg for Android with RTMP support. Much thanks to Chris Ballinger and Liu Feipeng

David Brodsky 80 Dec 13, 2022
Convert audio files inside your Android app easily. Supported formats: AAC, MP3, M4A, WMA, WAV and FLAC.

AndroidAudioConverter Convert audio files inside your Android app easily. This is a wrapper of FFmpeg-Android-Java lib. Supported formats: AAC MP3 M4A

Adriel Café 1.3k Jan 5, 2023
A mod of the Twitch Android Mobile App adding BetterTTV and FrankerFaceZ emotes

A mod of the Twitch Android Mobile App adding BetterTTV and FrankerFaceZ emotes

null 377 Jan 2, 2023
AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.

PhotoFiltersSDK PhotoFiltersSDK aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image medi

Zomato 2.5k Dec 23, 2022
DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope or time based moving. But you can create your own evaluator.

DexMovingImageView DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope o

Diego Grancini 310 Feb 7, 2022
HyperUPnP is Android Application that lets you to Stream Media from PC, NAS or any other device running UPnP/DLNA compliant media server to your Android Device.

Hyper UPnP Android UPnP/DLNA client Stream Media from PC, NAS or any other device running UPnP/DLNA compliant media server to your Android Device. Int

Var Bhat 8 Jul 17, 2022
Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image selection.

Awesome Image Picker Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image sel

Prabhakar Thota 162 Sep 13, 2022
Android library. Flexible components for chat UI implementation with flexible possibilities for styling, customizing and data management. Made by Stfalcon

ChatKit for Android ChatKit is a library designed to simplify the development of UI for such a trivial task as chat. It has flexible possibilities for

Stfalcon LLC 3.6k Jan 5, 2023
ANTLR is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

Tunnel Vision Laboratories, LLC 53 Dec 18, 2022
An Android app to stream and download your media stored in Google Drive in an Awesome way !!

⚡ Thunder : An Android app to stream and download your media stored in Google Drive in an Awesome way !! (Just Movies for now) ?? Getting Started : Le

null 278 Jan 5, 2023
The androidx.media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android

AndroidX Media AndroidX Media is a collection of libraries for implementing media use cases on Android, including local playback (via ExoPlayer) and m

Android Jetpack 310 Dec 29, 2022
Media Provider Manager - An Xposed module intended to prevent media storage abuse

Media Provider Manager - An Xposed module intended to prevent media storage abuse

null 104 Dec 26, 2022
Flexible switch is a responsive switch with some nice features which developers can use for making awesome switches on android platform.

flexible-switch It is a responsive switch in android, it can resize itself according to its size. It's recommended to use it with ConstraintLayout to

Coders Route 5 Dec 20, 2022
This project aims to provide a working page flip implementation for usage in ListView.

Changes: Made clickable views like a button clickable inside the FlipViewPager. Use RecyclerView. Updated to API 23. Added support for close clicks on

Yalantis 1.8k Dec 13, 2022
This project aims to provide a reusable pull to refresh widget for Android.

Pull To Refresh for Android Note This library is deprecated, a swipe refresh layout is available in the v4 support library. This project aims to provi

Johan Berg 2.5k Jan 2, 2023
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023