// Implementation of 'Image Negative' // // The following code negates the image by replacing every // pixel by it's compliment (255 - pixelValue) public class Negator extends Object { public void Negator() { } public int[] negatePixels(int inPixels[], int width, int height) { int outPixels[] = new int[inPixels.length]; for (int x = 0; x < inPixels.length; x++) outPixels[x] = 255 - inPixels[x]; return outPixels; } }