The only meaning of slope I can think of is to describe the angle of a line (ie: slope=0 is a flat horizontal line, slope=1 is a diagonal line going up-right, etc)
I don't understand how that applies to the colors of two pixels.
@Disch: think of gradient (well, modulus of gradient) http://en.wikipedia.org/wiki/Gradient
the grayscale image may be representing some variable like height or temperature.
@OP: I don't understand why are you multiplying the modulus by 256
pixel is in the range [0;255] so the slope is in range [-255;255], that would make the modulus being in range [0; \sqrt{2}*255] to which you multiply by 256