dapphp/securimage — comment on commit eca4cd8873d2765f091a6e5b409db421a9f0be11
File:  line 0
By Uranium235:

Hi,
you got me confused now...

As I know it, everything above 8 Bits/sample is stored as two's-complement in LE byte order (=signed). For 16 Bits that is the range of [-32768, 32767] (note the difference). And that is precisely what my code should take care of. You could even adjust it to handle below 8 Bits/sample by subtracting / adding $d/2 instead of 128 and replacing the "$BitDepth == 8" with "$BitDepth <= 8".