Image Gradient: Light to Dark, Dark to Light
The UINT8 type is limited to integer numbers on the range [0, 1, 2, ..., 255].
Hence negative values are clipped into 0.  

A solution could be wither use other types (Floating Points) or scale and shift.

For instance, given a Floating Point image with values imageMax and imageMean you can scale it into the [0, 1, 2, ..., 255] by doing:


Create only positive numbers: image - imageMin.
Scale it into the range: round(255 * (image - imageMin) / (imageMax - imageMin)).


Now the conversion won't loose data.

Others have different approach, set 128 to be zero.
Namely, add 128 to the image, clip it into [0, 255] and then convert to UINT8.

Enjoy.