In this paper a new automatic method is presented to enhance the image brightness through gamma correction process. Most of current gamma correction methods apply a uniform gamma correction across the image. Considering the fact that gamma variation for a single image is actually nonlinear, the proposed method does the gamma correction in a local approach. Thus the method is able to estimate appropriate gamma values for different regions of the image using a neural network. After windowing several training images with known gamma values, the mean and texture of each window (responsible for brightness and contrast of the window) are computed to train the neural network. The same features will be extracted from the unknown image to estimate the correct gamma values of the different parts of the image. Unlike other gamma correction methods, the proposed method does not change the gamma values of an image which does not need any brightness enhancement. The experimental results prove its better performance over other gamma correction methods.