@@ -0,0 +1,740 @@
+/**%0A * Filter that converts the color of image into negative.%0A */%0Apublic class NegativeFilter 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 current red, green and blue 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%09red = 255 - red;%0A%09%09%09%09green = 255 - green;%0A%09%09%09%09blue = 255 - blue;%0A%0A%09%09%09%09// Change color.%0A%09%09%09%09color.red = red;%0A%09%09%09%09color.green = green;%0A%09%09%09%09color.blue = blue;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09// Set color back.%0A%09%09pi.setData(data);%0A%09%7D%0A%0A%7D%0A

Create NegativeFilter.java