private static int calcCombinedIntensity ( final int element ) { final Color color = new Color ( element ) ; return Math . min ( 255 , ( color . getRed ( ) + color . getGreen ( ) + color . getRed ( ) ) / 3 ) ; }
Calculate the combined intensity of a pixel and normalizes it to a value of at most 255 .