Could you check the dtype and shape of the numpy array before transforming it to a PIL.Image and compare it to the result of the transformation? Based on the output the transformation might cause overflows e.g. if the dtype is also changed.
If you get stuck, please post an executable code snippet to reproduce this issue so that we could help in debugging.