I am interested in reading a pgm file in python as a numerical file/matrix
Right now I open the file with
f = open('/home/matthew/NCM/mdb001.pgm', 'rb')
When I read the first line, it looks as expected
r.readline()
produces
'P5\n'
and the next line is fine
'1024 1024\n'
and the next
'255\n'
but then I get a series of gibberish. It looks like some hex values mixed in with other stuff.
I don't want to view the file as an image picture, I just want to see it in this format.