You can try to convert your RGB image to Grayscale. If the image as 3 bytes per pixel rapresented as RedGreenBlue you can use the followinf formula: y=0.299*r+0.587*g+0.114*b.
To be clear iterate over the byte array and replace the colors. Here an example:
    byte[] newImage = new byte[rgbImage.length];
    for (int i = 0; i < rgbImage.length; i += 3) {
        newImage[i] = (byte) (rgbImage[i] * 0.299 + rgbImage[i + 1] * 0.587
                + rgbImage[i + 2] * 0.114);
        newImage[i+1] = newImage[i];
        newImage[i+2] = newImage[i];
    }
UPDATE:
Above code assumes you're using raw RGB image, if you need to process a Jpeg file you can do this:
        try {
            BufferedImage inputImage = ImageIO.read(new File("input.jpg"));
            BufferedImage outputImage = new BufferedImage(
                    inputImage.getWidth(), inputImage.getHeight(),
                    BufferedImage.TYPE_INT_RGB);
            for (int x = 0; x < inputImage.getWidth(); x++) {
                for (int y = 0; y < inputImage.getHeight(); y++) {
                    int rgb = inputImage.getRGB(x, y);
                    int blue = 0x0000ff & rgb;
                    int green = 0x0000ff & (rgb >> 8);
                    int red = 0x0000ff & (rgb >> 16);
                    int lum = (int) (red * 0.299 + green * 0.587 + blue * 0.114);
                    outputImage
                            .setRGB(x, y, lum | (lum << 8) | (lum << 16));
                }
            }
            ImageIO.write(outputImage, "jpg", new File("output.jpg"));
        } catch (IOException e) {
            e.printStackTrace();
        }