Mistakes were made. First float input should be clamped to 0 .. 1 not -1 .. 1. Second conversion to ubyte from ushort
Fixes loading issues with larger image files