How to add image effects in android ?-ThrowExceptions

Exception or error:

I am trying to apply effect (sepia, brightness, bloom and other image effects if API for them is available) on an image for my android app. But I am totally unable to get precise and well mannered code or concept for solving such problem. Although Android 4.0 (API 14) have build in api in it but I am working in Android 2.1 which have only Bitmap, Drawable, DrawableBitmap e.t.c but i am not getting which to work with.

How to solve:

I have written lots of image effects here, you can try:

Note: the tutorials are meant to explain how image effect algorithms are implemented in the most simple way, it’s not recommended for production usage.


As for Pete Answer I tried all of the classes he made and I’m sorry to be a party pooper but these classes are very slow
it took at least 10 sec to process an Image with them. in my case I needed to process 5 images before the user can proceed with the flow.

after a few hours I came across this excellent library,(super easy to integrate with gradle):

this is an example of how to use it:

 Transformation trans1 = new ContrastFilterTransformation(getActivity(), 1.5f);
                        Transformation trans2 = new BrightnessFilterTransformation(getActivity(), 0.2f);

Leave a Reply

Your email address will not be published. Required fields are marked *