title: How to read a .bmp file identify which pixels are black in Java
body: <p>Something like the following... except making it work:</p>
  
  <pre><code>public void seeBMPImage(String BMPFileName) throws IOException {
  BufferedImage image = ImageIO.read(getClass().getResource(BMPFileName));
  
      int[][] array2D = new int[66][66];
  
  for (int xPixel = 0; xPixel &lt; array2D.length; xPixel++)
      {
          for (int yPixel = 0; yPixel &lt; array2D[xPixel].length; yPixel++)
          {
              int color = image.getRGB(xPixel, yPixel);
              if ((color &gt;&gt; 23) == 1) {
                  array2D[xPixel][yPixel] = 1;
              } else {
                  array2D[xPixel][yPixel] = 1;
              }
          }
      }
  }
  </code></pre>