问题描述
目前在我开发我通过图像的像素循环模糊是一个Android应用程序。这对一个640×480的图像需要约30秒。
Currently in an Android application that I'm developing I'm looping through the pixels of an image to blur it. This takes about 30 seconds on a 640x480 image.
而在Android Market中的应用程序浏览我碰到一个包括虚化功能和它们的虚化非常快(如5秒),所以他们必须使用模糊不同的方法。
While browsing apps in the Android Market I came across one that includes a blur feature and their blur is very fast (like 5 seconds) so they must be using a different method of blurring.
任何人都知道一个更快的方式不是通过像素循环其他?
Anyone know a faster way other than looping through the pixels?
推荐答案
这是一个在黑暗中拍摄,但你可以尝试图像缩小,然后再次把它做大。这可以用 Bitmap.createScaledBitmap完成(位图SRC,诠释dstWidth,INT dstHeight,布尔型过滤器)
。确认和过滤器参数设置为true。它会在本地code运行,所以它可能会更快。
This is a shot in the dark, but you might try shrinking the image and then enlarging it again. This can be done with Bitmap.createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter)
. Make sure and set the filter parameter to true. It'll run in native code so it might be faster.
这篇关于快速的位图模糊对于Android的SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!