Write a function called blackAndWhite that has as input argument the file name of an image file (example: bluefish.gif), then transforms the image in black and white and displays it. In order to create a black and white image, do:
Prepare the image file: (i.e open the image file and convert it into RGB representation)
Display the initial image
Loop over each pixel in the image (hint: you'll need a nested for loop) and compute the average of r, g, b. Next, update the pixel value with average.
Save the new image in a file called: filename”_BW_mod.gif”
Display the black and white image on screen