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
Android Country Picker is a Kotlin-first, flexible and powerful Android library that allows to integrate Country Picker with just a few lines.

1. Add dependency dependencies { implementation 'com.hbb20:android-country-picker:X.Y.Z' } For latest version, 2. Decide your use-case

Harsh B. Bhakta 65 Dec 6, 2022
An easy, flexible way to add a shimmering effect to any view in an Android app.

Shimmer for Android Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as a

Facebook 5.1k Dec 26, 2022
Chandrasekar Kuppusamy 799 Nov 14, 2022
Render After Effects animations natively on Android and iOS, Web, and React Native

Lottie for Android, iOS, React Native, Web, and Windows Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations expo

Airbnb 33.5k Jan 4, 2023
Allows the easy creation of animated transition effects when the state of Android UI has changed

android-transition Android-Transition allows the easy creation of view transitions that reacts to user inputs. The library is designed to be general e

Kai 615 Nov 14, 2022
Web-based media manager with duplication detection, tagging, and more

reelchest ?? ??️ ??️ A basic web-based media manager. Download or upload clips,

Sebastian Aigner 7 Jan 3, 2022
A Flutter plugin thats support share files to social media like TikTok, Instagram, Facebook, WhatsApp, Telegram and more others...

Social Share Kit A Flutter plugin that's support share files to social media like Tiktok, Instagram, Facebook, WhatsApp, Telegram and more. This plugi

Kaique Gazola 2 Sep 2, 2022
Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines.

StrikedImageView Animate a strike over any image to indicate on/off states. As seen in the Material Guidelines. Gradle allprojects { repositories

null 9 Sep 21, 2022
An simple & awesome animation library written in Kotlin for Android

An simple & awesome animation library written in Kotlin for Android

Romman Sabbir 53 Oct 17, 2022
Awesome keyboard animator that supports Android SDK 23 ✨

KeyboardBeautify Awesome keyboard animator that supports Android SDK 23 ✨ This library was created based on the android/user-interface-samples. Previe

Ji Sungbin 9 Dec 8, 2022
FilePicker is a small and fast file selector library that is constantly evolving with the goal of rapid integration, high customization, and configurability~

Android File Picker ??️ 中文简体 Well, it doesn't have a name like Rocky, Cosmos or Fish. Android File Picker, like its name, is a local file selector fra

null 786 Jan 6, 2023
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

Nightonke 2.7k Dec 30, 2022
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

Stfalcon LLC 1.9k Jan 5, 2023
FragmentTransactionExtended is a library which provide us a set of custom animations between fragments.

FragmentTransactionExtended FragmentTransactionExtended is a library which provide us a set of custom animations between fragments. FragmentTransactio

Antonio Corrales 1.1k Dec 29, 2022
Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:

SpeedView Dynamic Speedometer, Gauge for Android. amazing, powerful, and multi shape ⚡ , you can change (colors, bar width, shape, text, font ...every

Anas Altair 1.2k Jan 7, 2023
Fast marker clustering library for Google Maps Android API.

Google Maps Clustering for Android A fast marker clustering library for Google Maps Android API. Motivation Why not use Google Maps Android API Utilit

Sharewire 294 Dec 5, 2022
A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix.

SuperForwardView About A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix. GIF Design Credi

Ertugrul 77 Dec 9, 2022
Image-search - An Image search android app with offline support

image-search Image search app built using bing image search API via paging 3. Fe

Suraj Vaishnav 3 Feb 17, 2022
🎨 Android colorpicker for getting colors from any images by tapping on the desired color.

ColorPickerView ?? ColorPickerView implements getting HSV colors, ARGB values, Hex color codes from any image drawables or your gallery pictures by ta

Jaewoong Eum 1.3k Jan 8, 2023