Look at ppm.h to see the description of the ppm structure and functions.
The RGB arrays in the ppm structure are declared using pointer notation
because they are dynamically sized and allocated -- but they behave
and are used just like regular two-dimensional arrays. So, for example,
the red color data for a ppm structure a
is in array
elements a.r[i][j], i=0...(a.rows-1), j=0...(a.cols-1)
Three sample images are provided: test.ppm, Flowers.ppm, and baby.ppm
Write a C program which reads a PPM image from standard input, swaps the red and green pixel values, and then writes the modified image to standard output.
Test your program using the image view icon with one of the sample images as input:
Sample results: original test image, swapped; original Flowers image, swapped
Write a C program which transposes an image, i.e. reflects it about the diagonal.
To do this, after reading a PPM image, create a new image of the appropriate size; copy the pixels from positions [j][i] of the original image to positions [i][j] of the new image; then write the new image to standard output.
Sample results: original test image, transposed; original baby image, transposed
The suspect in a bank fraud investigation has hidden a 6-digit account number in the green color plane of an image p3.ppm
Your job, as a digital image forensics specialist, is to extract the account number and submit it to the FBI to recover the stolen funds.
The account number image is encoded in the least-significant bits of the green pixel values. To decode the number: for each green pixel, if it is odd set it to 255, if it is even set it to 0. Then view the resulting image.
Check results - view the log entries for your image number submission
Write a program to generate an image which contains a range of color values 0...255 for each color plane and/or makes some interesting pattern.