An automatic fingerprint identification and verification system (AFIVS) depends on the comparison of local ridge characteristics and their relationships to make a personal identification. A critical stage in personal identification is to extract features automatically and reliably from the input fingerprint images. The performance of the feature extraction algorithm relies heavily on the quality of the input fingerprint images. The ridge structures in poor quality fingerprint images are not always well defined, and therefore, they can not be correctly detected. The success of a fingerprint image enhancement algorithm is to improve adaptively ridge and valley structures. This covers a set of processes on fingerprint images to improve their qualities. These processes can be called pre-processing of the automatic fingerprint identification and verification system. The purpose of preprocessing is to increase recognition quality and to avoid errors in identification. So pre-processing is very important for performance and reliability of the automatic fingerprint identification and verification systems. This study introduces a new approach to improve grayscale fingerprint images. The system processes the fingerprint images segment by segment and consists of four stages: enhancement of grayscale image, grayscale to binary thresholding, thinning and improving the thinned image. In order to do that an automatic fingerprint software was developed in Delphi. The results have shown that the new approach presented in this work is much better than the approaches presented in the literature.