title: Converting an image to black and white ( not gray scal)
body: <p>hello I am converting an image from color to pure black and white the result is a dark image. I am not getting the reason. Following is my code its been inspired by other codes on SO.
  Any guidance would be helpfull.  </p>
  
  <pre><code>BufferedImage coloredImage = ImageIO.read(new File("/home/discusit/ninja.png"));
  BufferedImage blackNWhite = new BufferedImage(coloredImage.getWidth(),coloredImage.getHeight(),BufferedImage.TYPE_BYTE_BINARY);
  Graphics2D graphics = blackNWhite.createGraphics();
  graphics.drawImage(blackNWhite, 0, 0, null);
  </code></pre>
  
  <p>I am not getting what I am doing wrong. Any more ideas using any other open source library would be fine. </p>
  
  <p>WORKING ::::: </p>
  
  <pre><code>BufferedImage coloredImage = ImageIO.read(new File("/home/abc/ninja.png"));
  BufferedImage blackNWhite = new BufferedImage(coloredImage.getWidth(),coloredImage.getHeight(),BufferedImage.TYPE_BYTE_BINARY);
  Graphics2D graphics = blackNWhite.createGraphics();
  graphics.drawImage(coloredImage, 0, 0, null);
  
  ImageIO.write(blackNWhite, "png", new File("/home/abc/newBlackNWhite.png"));
  </code></pre>