I want to make a surface based on the brightness at each point of this image. What is the mathematics behind this? I am thinking I need to create a function that takes in the brightness of each pixel and plots it at a height above the point, where brighter corresponds to higher and darker corresponds to lower.
Are there any applications of this?



There isn't much mathematics beyond what you already know: you need a function of two variables (pixel position) whose value at each point is the brightness there. You can build that by parsing the image in some way.
The image seems to be quite dark with some small white spots, which will make a very spiky surface.
There are many tools that will draw a surface for you. Search 3D graphing software. You could even consider Excel, or some programming language like Python.