Reputation: 1089
In discussion of gamma correction, most people write formula
y = 255 (x/255)^gamma
I guess this is applied for each channel: R, G and B. My quesion is following
shouldn't I rather analyze the image (I assume 8bit per color channel), find the maximum intensity pixel among all channels and then write
y = x_max (x/x_max)^gamma
?
Upvotes: 1
Views: 2127
Reputation: 17265
The answer is, generally, no: you should not normalize by the (content dependent) max grayscale value.
The gamma correction is exponential (thus, scale sensitive) and is done on the scale of [0,1].
In the case of 8-bit images, the max (possible) value is 255, so you normalize by 255
to scale the value range to [0,1].
Upvotes: 2