500px / 500px-android-blur

Android Blurring View
http://developers.500px.com/2015/03/17/a-blurring-view-for-android.html
MIT License
2.69k stars 326 forks source link

artifacts at the edge of the view #7

Open ianduke opened 9 years ago

ianduke commented 9 years ago

First, thanks for this great library!

I'm using your BlurringView to blur a full screen image in my app, but I'm getting artifacts at the edge of the screen where the image isn't blurred. I read in your blog post that you added the lines:

scaledWidth = scaledWidth - (scaledWidth % 4) + 4; scaledHeight = scaledHeight - (scaledHeight % 4) + 4;

to remove artifacts at the edges of the view, but for me, removing those two lines removed the artifacts. Is it safe to remove those lines? Do the artifacts depend on the image, the device, the downsample factor, or the blurring radius?

molikto commented 9 years ago

I always experienced the same thing from Renderscript (not this project) and never really solved it. What I do usually is just blur a bigger bitmap, so the artifacts will not be visible. Hope this repo can solve it, because my method is not useful anymore

luojun commented 9 years ago

@ireneduke sorry I wasn't able to get back to you earlier. One thing to look into could be the version of Android or RenderScript. Those lines were there to mitigate the effect of what's supposedly a bug in RenderScript. Maybe that's fixed in more recent versions?

But I didn't dig deep enough about how the various factors interact. I would suspect that image size and downsample factor would matter in terms of how the edge of the original image is trimmed. Device could matter in terms of the version of RenderScript. And I suspect blurring radius doesn't matter.

ndbroadbent commented 7 years ago

+1, I've noticed that this happening for me (when using react-native-blur.)

Also, sorry for commenting on such an old issue. But maybe if this is fixed in later versions of RenderScript, then it would be great to update the code for that. These days, I think it's safe to have a renderscriptTargetApi of 23. (That's what we are recommending for react-native-blur.)

You can see it happening at the right edge:

screenshot 2017-04-16 00 15 17

If this project is dead, then I think I might just copy the code into our own repo and change it there. But if someone from 500px reads this, please let me know if you would consider merging a PR and releasing a new version.

lihongxiangleo commented 6 years ago

How to solve this problem T T @ndbroadbent

Peretz30 commented 4 years ago

any updates?

mck182 commented 4 years ago

Hi all,

sorry for the late response - this project is not really maintained anymore as we've since redesigned our app and this component is no longer used.

We appreciate your interest in this library and with that said, feel free to submit a PR and I'll see what we can do to get it in.

Cheers, Martin from 500px