Reputation: 25738
I have RGB data and Gamma correction ration
Can I use the following to calculate
R = pow(R, 1/Gamma)
G = pow(G, 1/Gamma)
B = pow(B, 1/Gamma)
or Gamma correction only applies to intensity.(brightness)
Upvotes: 1
Views: 7248
Reputation: 1384
I think it shall be pow(R, gamma) and not 1/gamma and the same goes for the rest of the channels http://en.wikipedia.org/wiki/Gamma_correction
Upvotes: 0
Reputation: 1079
This should work correctly. For most RGB color encodings, gamma is applied per-channel.
Just be careful, R, G, and B are expected to be on a range [0,1] before applying the inverse gamma function.
Upvotes: 4