i need help with the coding of a program that will read a ppm file using command line arguments ( name of the ppm, name of output ppm) what it has to do is, open the file read and store the dimensions of the image and the pixel data. There are 3 channels in a given pixel with max values of 255. must be compatible with binary bytes of data using get or read methods.
then sort the pixels by luminence based on ( red*.3+green*.59+blue*.11 ) and write the newly sorted RGB values into a ppm (2nd argument in program)