test code for gamma correction