Write a C program to compute the photographic negative of an image. The program should be able to read the input image from an ASCII file, visit each pixel, and compute its photographic negative value (explained below). The program should save the output into an ASCII file of exactly the same format as the input file. Call the output file testimageneg.dat.
To produce the photographic negative of an image, the value of each pixel is replaced by the sum of its negative plus the upper end of the grayscale. For example, for an 8-bit system, the lower end of the grayscale could be 1, in which case the upper end would be 256. A pixel value of 10 (almost black) in the original image gets replaced with 256-10 = 246.