EE499 Image Processing Project 1 xx_pbmwrite


EE499 Image Processing Project 1 Write Octave routines appropriate).


file in the appropriate netpbm




, and


that take two arguments – an image as the first argument and a filename as the second argument. The routines write the image to the file format. The routines should test for the correct number of input arguments (nargin) and for the appropriate type (class or isa), dimension (ndims) and size (if There are test scripts and images for each of your routines (the images are used by the test scripts):


: pbmwrite_test.m

, clown_bkwh_int_uint1.png


: pgmwrite_test.m

, clown_gray_int_uint8.png


: ppmwrite_test.m

, clown_colr_rgb_uint8.png

The test scripts read in the test image and display it. They then write the image to disk using your routine, read the image back in from the new file and display it for comparison to the original image. They also create a random-sized image, display it, write it to disk using your routine, read it back in and then display the new image for comparison to the original.

Recommendation: Don't use the test scripts to test your routine during development. Create a small (2 x 3 or so) image and use that. (You could create a small image by hand or read in one of the small netpbm text files we used in class.) Open your output file with a hex editor to see if it is correct.

Grading: +75% if your


routine passes the pgmwrite_test test script.

+15% if your


routine passes the ppmwrite_test test script.

+10% if your


routine passes the pbmwrite_test test script.

Try to avoid loops if possible (it is!!). You especially want to avoid looping over the pixels in an image.

Note: The


routine will require allocating a new area of memory and twiddling bits to correspond to Octave's black and white image type.

Email your three routines as attachments to [email protected]

with the subject "EE499 – Project 1 –

Your Name