1
0
Fork
You've already forked AndroidPhotoFilters
0
Fork of AndroidPhotoFilters from Quang Nguyễn Viết
  • Java 76.4%
  • C++ 22.9%
  • Makefile 0.7%
Find a file
2025年11月12日 12:04:18 +01:00
art Add Project 2016年06月10日 16:31:49 +05:30
config Disable findBugs and Pmd 2016年06月14日 17:36:51 +05:30
example fix: remove setHasFixedSize call 2025年11月12日 11:08:08 +01:00
gradle/wrapper Upgrade dependencies and project settings 2025年11月12日 10:12:25 +01:00
imagefilters feat: Increase minSdk to 23 2025年11月12日 10:54:05 +01:00
.gitignore prepare before upgrade 2023年08月08日 22:38:18 +07:00
.travis.yml Update target/compile sdk to 23 2016年06月14日 17:29:57 +05:30
build.gradle update version to 1.0.8.1 2025年11月12日 11:10:43 +01:00
gradle.properties Upgrade dependencies and project settings 2025年11月12日 10:12:25 +01:00
gradlew Add Project 2016年06月10日 16:31:49 +05:30
gradlew.bat Add Project 2016年06月10日 16:31:49 +05:30
LICENSE Add Project 2016年06月10日 16:31:49 +05:30
local.properties Upgrade dependencies and project settings 2025年11月12日 10:12:25 +01:00
README.md Update README.md 2025年11月12日 12:04:18 +01:00
settings.gradle local 2017年10月30日 09:33:22 +05:30

Android Photo Filters

This library is forked from here. All credits goes to respective owners. This fork version migrates all deprecated android.support to 'androidx.appcompat' so you can completely set jetifier to false I also upgrade targetSdk to 36

How to use the Library

  1. Add to root (build.gradle (project)) at the end of repositories:
allprojects {
 repositories {
 ...
 maven { url 'https://jitpack.io' }
 }
}
  1. Include the Filters library in build.gradle
dependencies {
 implementation 'org.codeberg.Arne:AndroidPhotoFilters:1.0.8.1'
}

Latest version:

  1. Load the native library in your activity
publicclass MainActivityextendsAppCompatActivity{static{System.loadLibrary("NativeImageProcessor");}
  1. Get the pre defined Filter Pack to generate the thumbnails. Refer FilterPack.java to generate your own filters.
List<filter>filters=FilterPack.getFilterPack(getActivity());for(Filterfilter:filters){ThumbnailItemitem=newThumbnailItem();item.image=thumbImage;item.filter=filter;item.filterName=filter.getName();ThumbnailsManager.addThumb(tI);}
  1. Apply desired filter on to bitmap image.
// Accessing single filter...Bitmapbitmap=your_bitmap_;Filterclarendon=FilterPack.getClarendon();// apply filterimagePreview.setImageBitmap(filter.processFilter(bitmap));

The Filter Pack

Currently the below filters are available in filer pack. More will be added in future.

Struck Clarendon OldMan
Mars Rise April
Amazon Starlit Whisper
Lime Haan Bluemess
Adele Cruz Metropolis
Audrey

Features

(This is the older documentation from original page)

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

FiltermyFilter=newFilter();myFilter.addSubFilter(newBrightnessSubFilter(30));myFilter.addSubFilter(newContrastSubFilter(1.1f));BitmapoutputImage=myFilter.process(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 :

FiltermyFilter=newFilter();Point[]rgbKnots;rgbKnots=newPoint[3];rgbKnots[0]=newPoint(0,0);rgbKnots[1]=newPoint(175,139);rgbKnots[2]=newPoint(255,255);myFilter.addSubFilter(newToneCurveSubfilter(rgbKnots,null,null,null));BitmapoutputImage=myFilter.process(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 :

FiltermyFilter=newFilter();myFilter.addSubFilter(newSaturationSubfilter(1.3f));BitmapoutputImage=myFilter.process(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.

FiltermyFilter=newFilter();myFilter.addSubFilter(newColorOverlaySubfilter(100,.2f,.2f,.0f));BitmapoutputImage=myFilter.process(inputImage);

ContrastSubfilter

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

FiltermyFilter=newFilter();myFilter.addSubFilter(newContrastSubfilter(1.2f));BitmapoutputImage=myFilter.process(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 :

FiltermyFilter=newFilter();myFilter.addSubFilter(newBrightnessSubfilter(30));BitmapouputImage=myFilter.process(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.

FiltermyFilter=newFilter();myFilter.addSubFilter(newVignetteSubfilter(context,100));BitmapoutputImage=myFilter.process(inputImage);

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

License

This library falls under Apache v2