Search code examples
androidimagepixel

pixelate image in code


I've searched for how to pixelate an image in android via code, the results are varied.

I've found libraries and tutorials on how to apply other effects found here: http://xjaphx.wordpress.com/learning/tutorials/

Can someone clear things up for me, what is the simplest way of pixelating an image on the fly in android

Also it would be handy if it was a function that I could how many rounds or how much I wanted the image pixelating.

Thank in advance.


Solution

  • The simplest way to pixelate the image would be to scale image down using "nearest neighbour" algorithm, and then scale up, using the same algorithm.

    Filtering over the image trying to find an average takes much more time, but does not actually give any improvements in result quality, after all you do intentionally want your image distorted.