title: Enhancing ImageView brightness programmatically
body: <p>I have an android app in which I am increasing brightness of image with the code below. But this is very slow so does anyone knows a fast way to enhance image brightness of an imageview in android. Keep in mind this is improving imageview brightness not screen brightness</p>
  
  <pre><code> public static Bitmap doBrightness(Bitmap src, int value) {
      //Log.e("Brightness", "Changing brightnhjh");
  
      int width = src.getWidth();
      int height = src.getHeight();
      Bitmap bmout = Bitmap.createBitmap(width, height, src.getConfig());
      int A, R, G, B;
      int pixel;
      for (int i = 0; i &lt; width; i=i++) {
          for (int j = 0; j &lt; height; j=j++) {
              pixel = src.getPixel(i, j);
              A = Color.alpha(pixel);
              R = Color.red(pixel);
              G = Color.green(pixel);
              B = Color.blue(pixel);
              R += value;
              if (R &gt; 255) {
                  R = 255;
              } else if (R &lt; 0) {
                  R = 0;
              }
              G += value;
              if (G &gt; 255) {
                  G = 255;
              } else if (G &lt; 0) {
                  G = 0;
              }
              B += value;
              if (B &gt; 255) {
                  B = 255;
              } else if (B &lt; 0) {
                  B = 0;
              }
              bmout.setPixel(i, j, Color.argb(A, R, G, B));
          }
      }
      return bmout;
  
  }
  </code></pre>
  
  <p>this is the imageview</p>
  
  <pre><code>imageview.setImageBitmap(doBrightness(image, 40));
  </code></pre>