What general algorithm do they use? When you brighten a dark image, it increases the luminosity of dark pixels more than the bright ones. The bright pixels are not allowed to reach or surpass full white.

Any ideas?