I have hundreds of 128 x 128.pgm files with some shapes on them, and I think their color gamut is 255 (not sure about this, although it would be nice if the solution could also take this into), and I need extract these colors for image processing. Thus, I would like to get a 128 x 128 matrix with each element having a value from 0 to 255, with the condition of 256 colors.
As for the language, something in Python / Java / C # will do, preferably in that order. I can use either Windows or Linux, so exclusive libraries are not a problem.
source
share