A fingerprint image segmentation algorithm based on frequency of gray scale and 8-direction image is proposed. For the image with large peak-valley gray level difference, the fingerprint foreground area can be judged by the difference of two gray levels with more frequencies appeared in the historgram. For the image with small peak-valley gray level difference, the fingerprint foreground area can be judged by the direction of streak. The gray scale values in various directions can be calculated by using the template in 8 directions. The threshold of this method can be naturally determined according to the image, thus the difficulty and inaccuracy in selecting threshold can be avoided. Images with any differences of peak-valley gray level can be accurately segmented. The boundary of fingerprint can be solved and the fingerprint will not be changed. Experiments show that the method is 5.7875% lower of p error than squares difference and 5.6625% lower of p error than directional image method. Moreover, the method is more robust because the difference of peak-valley gray levels and the orientation information aren’t rigorous.