What blurring algorithm does Android's `createBlurEffect` use?

30 views Asked by At

From what I can tell the two most popular blurring algorithms are Gaussian Blur and Box Blur. I am curious which one Android uses in its RenderEffect method createBlurEffect. Alternatively, is there a way I can test this easily? Like create a small 3x3 bitmap and apply the effect to this bitmap and print out the subsequent colors? It seems hard to get a bitmap from this.

1

There are 1 answers

0
Gabe Sechan On

Since it's not in the documentation, then you shouldn't treat it as either. Even if they happen to be using method X right now, they could change it at any time to Y. Or even some less common method. You can look up the source code (which seems to just dump off to a C native function that I'm not going to look up) in AOSP and see what it's using now, but there's no promise it wasn't using something else in older versions, or it won't change to something else next version