title: How to use the Renderscript blurring effect without artifacts?
body: <h2>Background</h2>
  
  <p>There are plenty of places (including <a href="https://stackoverflow.com/q/2067955/878126"><strong>here</strong></a>) to show how to use Renderscript to blur images, as such:</p>
  
  <pre><code>@TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
  public static Bitmap renderScriptBlur(Context context, Bitmap srcBitmap, @FloatRange(from = 0.0f, to = 25.0f) float radius) {
      if (srcBitmap == null)
          return null;
      Bitmap outputBitmap = null;
      RenderScript rs = null;
      try {
          rs = RenderScript.create(context);
          outputBitmap = Bitmap.createBitmap(srcBitmap.getWidth(), srcBitmap.getHeight(), Bitmap.Config.ARGB_8888);
          final Canvas canvas = new Canvas(outputBitmap);
          canvas.drawBitmap(srcBitmap, 0, 0, null);
          Allocation overlayAlloc = Allocation.createFromBitmap(rs, outputBitmap);
          ScriptIntrinsicBlur blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
          blur.setInput(overlayAlloc);
          blur.setRadius(radius);
          blur.forEach(overlayAlloc);
          overlayAlloc.copyTo(outputBitmap);
          return outputBitmap;
      } catch (Exception ex) {
          if (outputBitmap != null)
              outputBitmap.recycle();
          return srcBitmap;
      } finally {
          if (rs != null)
              rs.destroy();
      }
  }
  </code></pre>
  
  <h2>The problem</h2>
  
  <p>Usually it works great, but when using some images and/or radius-settings, the output image has artifacts that look like scan-lines:</p>
  
  <p><a href="https://i.stack.imgur.com/YmE2f.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/YmE2f.jpg" alt="enter image description here"></a></p>
  
  <h2>What I've tried</h2>
  
  <p>I've found that there is a nicer blurring solutions (like <a href="https://stackoverflow.com/a/10028267/878126"><strong>here</strong></a>), but they don't use Renderscript and are also slow and memory-consuming.</p>
  
  <p>I've also tried to make the input image smaller, but the output still has scanlines artifacts. </p>
  
  <p>Finally, I've also reported about this, <a href="https://code.google.com/p/android/issues/detail?id=205966" rel="noreferrer"><strong>here</strong></a>.</p>
  
  <h2>The question</h2>
  
  <p>Is it possible to use Renderscript to blur images without those Artifcats? Is there anything wrong with what I wrote? </p>