1. The pre-processing step does not have to take so long. When blurring an image, a very common technique is to work on a downsampled version of the bitmap.

    You first create a bitmap that’s 50% or 25% (or less) the size of the original bitmap, using bilinear filtering to create the smaller version. You can then blur this smaller version using a smaller radius (since you’ve already blurred the image a bit.) And at draw time you can simply scale the image back up, still using bilinear filtering to blur it even further. Not only is this solution faster but it also uses a lot less memory since you only keep a smaller version of the bitmap in RAM. You could also use multiple threads on multi-core devices.

    You could (and should) also use Renderscript to do the blurring when you’re running on Android 4..0+. You’ll easily get an order of magnitude or two faster.

  2. Also, you don’t have to use RelativeLayouts in your example. Simple FrameLayouts + layout_gravity will suffice and be much more efficient.

  3. I’d like to point out that on API 17 and above you can (and probably should) use RenderScript to accomplish this effect!


    It offers a higher-quality Gaussian blur but with the likelihood of being more performant. I haven’t actually profiled anything or tracked allocations, but it seems logical. If nothing else, I use it in my application without any notable drops in performance and the effect looks better in my opinion.

  4. Richard Acquaye

    There’s a slight flaw/bug to consider. When the device’s orientation is rotated, the blur effect (on content text) resets and this shouldn’t be so. It should carry over the scroll position and alpha data over when orientation is changed.

    Other than that, I really enjoyed the demo!

  5. Pranav


    Thanks a lot for this implementation.
    Can you suggest something on this:
    I want to have a Yahoo Weather like information instead of the ListView we are using. I wanted display some information, maps, etc.
    Any suggestions?

    • Hi,
      Sorry for the late answer.
      The “Yahoo Weather effect” will work on any ScrollView, as the effect works on a ScrollListener.
      Be careful to avoid OutOfMemory crash if your activity allows orientation change.

  6. Flavio Ramos

    So Yahoo just released the new Weather app for Android, and the blurred picture is just another image downloaded separately. Sad.

  7. Im attempting to take this and implement it into a Dialog, to achieve the new iOS 7 look. How would i go about using the java.io.Files and being able to access the getFilesDir and all the other methods that i now cannot access because I’m using extends Dialog and not a extends Activity like your MainActivity does… any workaround? Basically im getting a bunch of “Cannot resolve methods”

  8. Zeeshan

    very nice example , but one thing i noticed is that for image parallax effect you are moving the imageview where as in the Yahoo weather app the image inside the imageview moves.

  9. Andy Vavrynets

    Great effect and solution. But I can’t find out how to use it when I want make blur effect in my Dialogs? Here You use blur image, but have can I blur all background if there are to make ImageViews and Buttons ?

    Thx, Andy.

  10. Kirti Avaiya

    I had done with minimum API level 8 by removing switch and unwanted component for my need.

  11. Pablo

    Could you explain how to make it with renderscript?

    Is not the best way do it in real time with renderscript?

  12. nick

    Please lookup how to us “a” and “an” in a sentence, and when you should use one over the other.. You’ve used the wrong one several times in this page, and it totally throws people off when you use the wrong one.

  13. Martin Marconcini

    Nice trick. I’m curious about your use of:


    According to View.java: “This method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout.”

    Doesn’t this cause excessive layout?

    • As far as I know, this doesn’t cause any problem. But the article wasn’t about the parallax effect and I dig not dig really hard. Maybe a translation would be better even if only available for API 11+.

      • Martin Marconcini

        Thanks for the reply 😉 (it does cause some re-layouting, but doesn’t seem to be noticeable).

        One day I’ll have time to experiment and try with translation 😉

  14. You can use Renderscript of Support Library, as it is compatible with API 8+ and now is supported by Android Studio 0.5.+

    By the way, a use of this blur effect in Paralloid library would be great 🙂

  15. Philippe

    Hi Nicolas!

    Thank you for your hard work, this is extreamly helpful! but i have another question: is it possible to implement that code to make the notification panel blured? i have no problems to make it transparent or with a custom picture, but blured..?

  16. houssan


    can i use it with GridView? the problem is i cant addHeaderView(headerView); in gridview.

    Can help me?

  17. David Fagundes

    Hi Nicolas, very nice work man! Thanks for your imagination and skill.
    May I ask you, how do I move the Bluried to the bottom of the image?
    I want to make an effect like:
    [bluried image bar]
    [textview scrollable*]

    If i put that inside a fragment and put inside a pager will the parallax work horizontally?

  18. First i want to thanks God for creating an Amazing Developer like.
    Second i wanna thank you for taking your time give a detailed xplanation of this Blur Effect.

    I have been playing around it and i must say ur codes are superB as its works like charm.

    Here is a link of an App i am still working on if you wanna take a look


    But i noticed something about the blurredImage in the background.
    It retains the first formed image by the Bitman.
    I realized that after i made my app to load random images on the blurred_image & normal_image as the app load. I realized that the blured image which is created by >>Bitmap newImg = Blur.fastblur returns only one image, which is normally the first image the app loads. So even the image in the headerView still shows the old/firstLoaded image. At a first Glance, it looks cool but on a second though, it ruins my effect.

    So now the question is, how do i load new BlurImage each time the App loads .

    I will appreciate ur feedback a great deal.

Leave a Reply

Your email address will not be published. Required fields are marked *