I am trying to convert an image only to black and white (not gray).
I used this:
BufferedImage blackAndWhiteImage = new BufferedImage(
dWidth.intValue(),
dHeight.intValue(),
BufferedImage.TYPE_BYTE_BINARY);
Graphics2D graphics = blackAndWhiteImage.createGraphics();
graphics.drawImage(colourImage, 0, 0, null);
return blackAndWhiteImage;
Everything is fine until I decided to try bright colors, for example, the Google logo:

and it turned out:

Then I first tried going through the gray scale using:
BufferedImage blackAndWhiteImage2 = new BufferedImage(
dWidth.intValue(),
dHeight.intValue(),
BufferedImage.TYPE_USHORT_GRAY);
And it seems that he retained the blue color, but not the brightest (in this case, yellow), and, as you can see, it decreased in quality:

Any suggestions are greatly appreciated; I believe that I am looking to convert every color to black except white (which will be the background color), this is already done by applying TYPE_BYTE_BINARY removing the alpha channel.
EDIT:
Maybe I didn’t explain very clearly:
- the final image should have a white background ** 1
** 1 - , . (whiteOnBlackExample), , , "" .
, -, → - ;