title: RenderScript not rendering ScriptIntrinsicBlur correctly, causing the ScriptIntrinsicBlur to render a rainbow of colors
body: <p>Using the glide android library I get the image as a bitmap (<a href="https://github.com/bumptech/glide/wiki/Custom-targets" rel="nofollow noreferrer">see glide documentation</a>) and then I try to blur the bitmap, using renderscript and ScriptIntrinsicBlur, which is a gaussian blur. (<a href="https://stackoverflow.com/a/23119957/4484340">Taken from this stackoverflow post</a>)   </p>
  
  <pre><code> Glide.with(getApplicationContext())
      .load(ImageUrl)
      .asBitmap()
      .into(new SimpleTarget&lt;Bitmap&gt;(300,200) {
          @Override
          public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
  
              RenderScript rs = RenderScript.create(mContext); // context = this. this referring to the activity
  
              final Allocation input = Allocation.createFromBitmap( rs, resource, Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT );
              final Allocation output = Allocation.createTyped( rs, input.getType() );
              final ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create( rs, Element.U8_4( rs ) );
              script.setRadius(8f);
              script.setInput(input);
              script.forEach(output);
              output.copyTo(resource);
  
              mImageView.setImageBitmap(resource); 
          }
      });
  </code></pre>
  
  <p>The problem is that this is the output, rather than a blurred image:
  <a href="https://i.stack.imgur.com/THV6S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/THV6S.png" alt="enter image description here"></a></p>
  
  <p>Any help would be much appreciated thanks. :)</p>