I am building an android app which provides the user with some image processing functionalities. But before applying any image transformation function I would like to do gamma correction to improve the image. I know how to perform the gamma correction but I don’t know what gamma value to use as the image itself doesn’t have the gamma value with which the image was created. Any information regarding how to select a gamma value for a particular image will be very helpful.
Share
It appears that what you really want is to lighten or darken the average brightness of an image to match some optimum value. Yes, the gamma function can do that. It might not be the best choice, in fact for under or over exposure a simple linear multiplication might be better. But let’s stick with gamma for now.
Measure the average brightness of the image and call it
a, with values from 0-255. You have a target for the optimum brightness, let’s call thatt. If the unknown gamma isgthen you get:Solving for
ggives: