public static int getWashedOutPixel(BufferedImage img, int x, int y, float alpha) {
        // Get the raw pixel value
        int rgb = img.getRGB(x, y);

        // Extract the color components
        int a = (rgb >> 24) & 0xFF;
        int r = (rgb >> 16) & 0xFF;
        int g = (rgb >> 8) & 0xFF;
        int b = rgb & 0xFF;

        // Define the overlay gray color (same value for r, g, b)
        int gray = 128;

        // Blend the original color with the gray color
        r = (int) ((1 - alpha) * r + alpha * gray);
        g = (int) ((1 - alpha) * g + alpha * gray);
        b = (int) ((1 - alpha) * b + alpha * gray);

        // Clamp the values to the range [0, 255]
        r = Math.min(255, r);
        g = Math.min(255, g);
        b = Math.min(255, b);

        // Combine the components back into a single int

        return (a << 24) | (r << 16) | (g << 8) | b;
    }
This produces the almost grey ghost of the original image, used when the differences are being highlighted
jme3-screenshot-tests/src/main/java/org/jmonkeyengine/screenshottests/testframework/TestDriver.java