TwistedMind
If you want an approximate rescale to fit 0-1, you could do something like this:
var result = clamp((value-0.5)*scale+0.5,0,1)
where value is the grey value from the pixel map and scale is some number that scales the value to hit 0 and 1 range, with the clamp then making sure it doesn't go outside of that range.
If you know the exact min and max of the entire pixel map, you could precisely scale it to 0,1 range using:
var result = range_lerp(value, mini, maxi, 0, 1)
range_lerp takes a value in one range and remaps it to a different range (in this case 0,1).