This program takes a ppm file and outputs its equivalent in a black and white gradient, with either of the average and luminance algorithms. First it checks the command line arguments, then the magic value in the input file, then dimensions, which are also saved as ints, and finally the max color value. Then it converts all the image data and writes it in the output file.