I need to create a single greyscale histogram of a PGM image for a class project. I already have the code to read the PGM image. However I don't completely understand how to count the unique pixel values. I don't need to output a graph or anything like that. Any help would be greatly appreciated!
Code for reading PGM image http://sun.iwu.edu/~shelley/sie/zoo/journal/pgm.c.html