title: reading black/white image in java with TYPE_USHORT_GRAY
body: <p>I have the following code to read a black-white picture in java.</p>
  
  <pre><code>imageg = ImageIO.read(new File(path));    
  BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null),  BufferedImage.TYPE_USHORT_GRAY);
          Graphics g = bufferedImage.createGraphics();
          g.drawImage(image, 0, 0, null);
          g.dispose();
          int w = img.getWidth();
          int h = img.getHeight();
          int[][] array = new int[w][h];
          for (int j = 0; j &lt; w; j++) {
              for (int k = 0; k &lt; h; k++) {
                  array[j][k] = img.getRGB(j, k);
                  System.out.print(array[j][k]);
              }
          }
  </code></pre>
  
  <p>As you can see I have set the type of BufferedImage into TYPE_USHORT_GRAY and I expect that I see the numbers between 0 and 255 in the two D array mattrix. but I will see '-1' and another large integer. Can anyone highlight my mistake please?</p>