My Power Law (Gamma) Transformation Code Doesn't Compatible With Gamma Value
Gamma correction can be applied to values ranging between 0 and 1. Based on your code, it looks like there is either no conversion from 0..255 range to 0..1 range and back. If there range really is 0..1, the intermediate result is stored in an integer so it is an issue anyway.