@ahojnnes : The reason for using log2 is to normalize the intensity scaling i.e. for 255 in uint8 image, `np.log2(1 + image / scale)` will give exactly 1 for gain 1.