Due date: Tuesday, 6 Aug
The goal of this assignment is to ensure that you are able to read, write, and edit images, so that you do not waste any time getting set up when working on the actual graded assignments.
Write a program that takes two file names as input, one for the input RGB image and one for the output. You may use any language of your choice, and any image I/O library that give you direct access to the pixel array.
Read the input file to obtain the image as a \(w\times h\times 3\) array (or \(h\times w\times 3\) depending on the convention used by the library) — or equivalently, as an abstract data type that allows random access by pixel coordinate \((i,j)\) and colour channel \(c\).
For each row, compute the average pixel colour, and set all pixels in that row with the average colour, producing an image made of horizontal stripes. Here you may have to be a bit careful about the data type of pixel values: for example, if all values are stored as bytes, computing the average will require conversion to a higher-precision data type.
Write the averaged image to the given output filename.
Submit your code on Moodle by the end of Tuesday, 6 August.
This assignment is only for your preparation and does not contribute to your final course grade. However, you are required to make a good-faith attempt to complete it, and to correctly perform at least two of the three operations in the requirements. If you do not submit a reasonable attempt by the deadline, you will be penalized 20% of the marks for the first actual assignment.
You are permitted to use your 5 free late days for this assignment as well (though I really suggest you don’t).