Learning Android Development

How to Blur an Image on Android

Build an image-blurring algorithm

Picture by Jean-Louis Paulin on Unsplash

There’s no blurring API provided by Android out of the box for developers to use. So, this blog shares the basic algorithm of how blurring an image is done, and also an optimized algorithm that could do that in linear time.

Note: If you like to learn some existing Android-provided image manipulation features, check out LightingColorFilter, ColorMatrix, and PorterDuff.

To do that, I explore manipulating the pixel myself to blur it. Let me share with you the algorithm for doing so, in the most basic way, and I’ll share the code for doing so (image below).

Blurring Image Basics

All digital images are made up of pixels, such as below.

--

--