While standard compression methods available include complex source encoding schemes, the scanning of the image is often performed by a horizontal (row-by-row) or vertical scanning. In this work a new scanning method, called ridge scanning, for lossless compression of fingerprint images is presented. By using ridge scanning our goal is to increase the redundancy in data and thereby increase the compression rate. By using orientations, estimated from the linear symmetry property of local neighbourhoods in the fingerprint, a scanning algorithm which follows the ridges and valleys is developed. The properties of linear symmetry are also used for a segmentation of the fingerprint into two parts, one part which lacks orientation and one that has it. We demonstrate that ridge scanning increases the compression ratio for Lempel-Ziv coding as well as recursive Huffman coding with approximately 3% in average. Compared to JPEG-LS, using ridge scanning and recursive Huffman the gain is 10% in average.