Automatic gray scale correction of captured video data (both still and moving images) is one of the least researched questions in the image processing area, in spite of this the question is touched almost in every book concerned with image processing. Classically it is related to the image enhancement, and frequently is classified as histogram modification techniques. Traditionally used algorithms, based on analysis of the image histogram, are not able to decide the problem properly. The investigating difficulties are associated with the absence of a formal quantitative estimate of image quality -- till now the most often used criteria are human visual perception and experience. Hence, the problem of finding out some measurable properties of real images, which might be the basis for automatic building of gray scale correction function (sometimes identified also as gamma-correction function), is still unsolved. In the paper we try to discern some common properties of real images that could help us to evaluate the gray scale image distortion, and, finally, to construct the appropriate correction function to enhance an image. Such a method might be sufficiently used for automatic image processing procedures, like enhancing of medical images, reproducing of pictures in the publishing industry, correcting of remote sensing images, preprocessing of captured data in the computer vision area, and for many other applications. The question of complexity of analysis procedure becomes important when an algorithm is realized in real-time (for example in video input devices, like video cameras).