Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Give a posterize effect on imageview?

i am trying to give a Photoshop posterization effect to imageview.here is a normal image.

enter image description here

after applying posterization effect it should look like this,this effect is taken from pixlr image editor

enter image description here

I want exact effect programmatically.

what I have tried is, I am trying to get similar effect with SaturationFilter kind of effect, as I am not able to find posterization method for android.

here is my function http://pastie.org/8007887

and resulting image is,as below which is not looking similar to Photoshop posterized effect, I have tried passing several saturation level,but no luck.i hope some one will guide me in a proper way.

enter image description here

found some way, http://developer.android.com/reference/android/media/effect/EffectFactory.html here is a guidline for posterization effect,and that is applicable for android API level 14,what about device which use API level <14?

like image 273
Aamirkhan Avatar asked Jun 05 '13 05:06

Aamirkhan


1 Answers

There is a good library available named JHLabs' Java Image Processing.

It has lots of image processing filters available. I also use that library in my application. It is very compatible with Android also.

You can also download source code and run sample application.

JAR Download : http://www.jhlabs.com/ip/filters/Filters.zip

like image 160
Chintan Rathod Avatar answered Nov 13 '22 15:11

Chintan Rathod