raster2vector provides a tool which takes an image in PNM format and creates PostScript code to trace over the non-white bits.
This project started because I wanted a scalable PostScript version of my signature, which I had scanned. The tool takes an image in PNM format and creates PostScript code to trace over the non-white bits. This only really makes sense if the image input is an edge map (see canny_edge below to make an edge map from a regular image).
While writing this, it occurred to me that this is also a pretty good way to efficiently store scanned documents, assuming that you want a high resolution monochrome representation of the scanned page for storage. The project still has plenty of room for improvement.
Of course, after I had finished it to its current state, I found potrace, which is a very very similar, though much more mature, project. As far as I can tell, the algorithms used are completely different however, so depending on the input and the desired use of the output, one might perform better than the other.
In my limited testing, my raster2vector produced significantly smaller output files, which is obviously better for archiving scanned documents, but it was by no means an exhaustive or objective study.