average calculation of luminance