title: How to detect red pixels in a Bitmap
body: <p>Does getPixels() in android read the pixels up-down left-right, or left-right up-down. Basically does it read by rows, or columns. If I wanted to tell where in a picture are the red values higher, can I do this(I assumed it read by columns).</p>
  
  <pre><code>        Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
  
          imgTakenPhoto.setImageBitmap(thumbnail);
          int[] pixels = new int[thumbnail.getHeight()*thumbnail.getWidth()];
  
          thumbnail.getPixels( pixels, 0, thumbnail.getWidth(), 0, 0, thumbnail.getWidth(), thumbnail.getHeight());
          Colered[] color = new Colered[pixels.length];
          int length = pixels.length;
          int width = thumbnail.getWidth();
          int height = thumbnail.getHeight();
          for(int i=0; i&lt;pixels.length;i++){
              color[i] = new Colered(getRed(pixels[i]),getBlue(pixels[i]),getGreen(pixels[i]));
              System.out.print(color[i].red + " ");
          }
          int indice=-1;
          int greatest = -1;
          for(int i=0;i&lt;length-1;i++){
              if(color[i].red&gt; greatest){
                  greatest = color[i].red;
                  indice = i;
              }
  
  
          } 
  
         public static int getRed(int color){
      return (color &gt;&gt; 16) &amp; 0xFF;
     }
  </code></pre>