The function calculates the maximum values of the two images Input1 and Input2 pixel by pixel.