@@ -0,0 +1,727 @@
+/**%0A * This will convert the color of image into black and white.%0A */%0Apublic class BlackandWhiteFilter implements Filter %7B%0A%09public void filter(PixelImage pi) %7B%0A%09%09// Get all information about the picture.%0A%09%09Pixel%5B%5D%5B%5D data = pi.getData();%0A%0A%09%09for (int row = 0; row %3C pi.getHeight(); row++) %7B%0A%09%09%09for (int col = 0; col %3C pi.getWidth(); col++) %7B%0A%09%09%09%09// Get the current red, green and blue color of the picture.%0A%09%09%09%09Pixel color = data%5Brow%5D%5Bcol%5D;%0A%09%09%09%09int red = color.red;%0A%09%09%09%09int green = color.green;%0A%09%09%09%09int blue = color.blue;%0A%0A%09%09%09%09// Convert color.%0A%09%09%09%09int sum = (red + green + blue) / 3;%0A%0A%09%09%09%09// Change color.%0A%09%09%09%09color.red = sum;%0A%09%09%09%09color.green = sum;%0A%09%09%09%09color.blue = sum;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09// Set colors back.%0A%09%09pi.setData(data);%0A%09%7D%0A%7D%0A

Create BlackandWhiteFilter.java