Question: Creating a Negative / * Method to negate the picture * / public void negate ( ) { Pixel [ ] pixelArray = this.getPixels (

Creating a Negative
/* Method to negate the picture */
public void negate(){
Pixel[] pixelArray = this.getPixels();
Pixel pixel = null;
int redValue, blueValue, greenValue =0; for (int i =0; i < pixelArray.length; i++)
{ pixel pixelArray[i];
redValue = pixel.getRed();
greenValue = pixel.getGreen();
blueValue pixel.getBlue();
pixel.setColor(new Color(255- redValue, 255- greenValue, 255-
} blueValue));
}
}
explain the code kindly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!