So I'm trying to do a full-scale contrast stretch to a grayscale image, and I'm getting some really strange answers. I've identified the problem, just not the solution.
Taking a test point, I(2,2) = 108.
(I(2,2) - 57)
Ans = 51, as you'd expect. Now here's the weird part:
(I(2,2) - 57)*255
Ans = 255.
If I do 51 * 255 explicitly, I get the correct answer (13005). What am I doing wrong?