Generate an attractive profile from a DEM/DSM of a mountain
On a Linux computer with basic software development packages installed, you should be able to do the following:
make
./mountainplots.bin -i Matterhorn5m.png --elevs 1647 4748 --mpp 5 -d 1.5 -o MatterhornProfile.png
The above commands should result in creation of the profile image of the Matterhorn seen below.
The measure of a mountain is far more than its summit elevation. While "prominence" is an easily accessible second measurement, I find that no small set of numbers can communicate the complex character of a mountain. This program is my attempt at measuring and classifying mountains.
It generates an "x-ray" of the surface of the mountain, given by a DEM (digital elevation model) or DSM (digital surface model) in png format (we recommend using 16 bits per channel, greyscale only), rotated around the summit point. The image sets the bottom pixel row to sea level and uses the spatial resolution as the vertical resolution (5 meters per pixel in the above example).
The resulting image communicates much of the character of a mountain: how high is it, how does it rise from its base, how conical or symmetric is it, how steep are its most dramatic walls, how steep is the typical slope, are there neighboring or sub-peaks, etc.
Thanks to the developers of CLI11 and libpng.
I don't get paid for writing or maintaining this, so if you find this tool useful or mention it in your writing, please please cite it by using the following BibTeX entry.
@Misc{mountainprof2026,
author = {Mark J.~Stock},
title = {mountainprofile: Generate an attractive profile from a DEM/DSM of a mountain},
howpublished = {\url{https://github.com/markstock/mountainprofile}},
year = {2026}
}

