private static PixelSamenessDegree categorisePixelDifference(int pixel1, int pixel2){
        if(pixel1 == pixel2){
            return PixelSamenessDegree.SAME;
        }

        int pixelDifference = getMaximumComponentDifference(pixel1, pixel2);

        if(pixelDifference<= PixelSamenessDegree.NEGLIGIBLY_DIFFERENT.getMaximumAllowedDifference()){
            return PixelSamenessDegree.NEGLIGIBLY_DIFFERENT;
        }
        if(pixelDifference<= PixelSamenessDegree.SUBTLY_DIFFERENT.getMaximumAllowedDifference()){
            return PixelSamenessDegree.SUBTLY_DIFFERENT;
        }
        if(pixelDifference<= PixelSamenessDegree.MEDIUMLY_DIFFERENT.getMaximumAllowedDifference()){
            return PixelSamenessDegree.MEDIUMLY_DIFFERENT;
        }
        if(pixelDifference<= PixelSamenessDegree.VERY_DIFFERENT.getMaximumAllowedDifference()){
            return PixelSamenessDegree.VERY_DIFFERENT;
        }
        return PixelSamenessDegree.EXTREMELY_DIFFERENT;
    }
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