I am working with a grey scale image from a DEM. No matter how much Googling or reading I do I can NOT find a solution for Getting elevation values from a raster images pixels. It should be as simple as referencing a legend and seeing that black equals X value and White equals Y value and interpolating the grey scale values in between. However this task seems impossible without libraries like GDAL or ArcGIS. I simple need to take an image in Python and grab a specific pixel then find the value within the pixel that from my understanding matches the grey scale value and a corresponding height.
I am looking to write this implementation in Python as I am stronger with the language and understand how to accomplish my goals using standard and additional libraries. I am writing a mobile application that mainly requires one thing... offline elevation data globally. I have my dataset that holds this information in raster images. I know the coordinates of every pixel. The only unknown is getting the elevation from each pixel. Each pixel is in grey scale, black being ZERO feet above sea level and white being the highest elevation. I am assuming that each intensity increase from one darker shade of grey to a lighter/more intense shade of grey is a 1 unit increase in elevation above sea level. I will correct for gravity later as I have completed this part. I simple need to know the implementation that takes the PNG file, then gives me the value of color for each pixel of which I can later change to coordinates and that's it. So I am avoiding libraries and will likely need to rewrite this code in Swift later when I decide to port this functionality over to the app. I am holding off on jumping directly into swift because I can complete a working example faster and which better understanding. I would not attempt to learn a new Math topic in a language I do not speak as I would be fighting the language and not grasping the topic.
How would I go about getting a single greyscale color value of a given pixel in an image in the Python language if I chose to avoid using common libraries and stuck to using only the Standard Python Library?