maximum contrast using linear gery-level trasformation this was a question i found online.

given an image with values between [0,1].
how can I get the maximum contrast using linear gray-level transformation? 
something like I(x,y)=A*I(x,y)+B , where I is a histogram.
we are also given MAX(I) and MIN(I).

as far as i can understand. 
MAX(I) and MIN(I) will give you the values you have now and you wan to stretch the values into 0 and 1. 

but how will this give me a linear equation?
If you're subtracting the minimum and stretching the maximum remaining value to be 1, you get the following:

Let $m = \min\{I(x,y)\}$ and $M = \max\{I(x,y)\}$
$$I_{\text{new}}(x,y) = \frac{I(x,y) - m}{M-m} = AI(x,y)+B $$

where $A=\dfrac{1}{M-m}$ and $B = -\dfrac{m}{M-m}$

Hope this clears it up.