# Non Linear Remapping of the Pixel Values

Suppose you take a photo of a beautiful scene of mountains and a lake. The representation devotes half of the scale between black and white to the bright surface of the lake, and the other half to the subtle shadings of the mountains. Is it possible to change the mapping so that only ¼ of the scale is devoted to the lake's colors, and ¾ to the mountains shades? If so, how would you do it?

• I did my best explaining it in words. – user65652 Nov 28 '15 at 17:54
• do you still need more clarification ? – user65652 Nov 28 '15 at 19:06

Yes, using a non-linear mapping function on the intensity. Let us for the moment suppose you have a grayscale image (because of the words "black and white", "shadings"), with luminance $0\leq p_{i,j} <1$.
The piecewise linear mapping: $f( p_{i,j}) = \frac{p_{i,j}}{2}$ if $p_{i,j}<\frac{1}{2}$, and $f( p_{i,j}) = \frac{3}{2} (p_{i,j}-\frac{1}{2})+\frac{1}{4}$ if $p_{i,j}\geq\frac{1}{2}$ can do the job.