

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Lab; Class: Computer Science 1; Subject: Computer Science; University: Columbus State University; Term: Unknown 1989;
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Topics To replace one color with another in a picture To conditionally execute a statement or block of statements using an if statement.
Type in the following code in the Program window (changing the comments): import java.awt.Color; /* Program that transforms pictures using loops and conditionals
pix = pixels[index]; // if the color is near brown then double the amount of red if (pix.colorDistance(brown) < 50.0) { pix.setColor(new Color( (int) (pix.getRed() * 2.0), pix.getGreen(), pix.getBlue()) ); } //end if } //end loop } ii) Type in the following code in the Program window in the main method and before the pic.show(); turnBrownIntoRed (sourcePicture); iii) Test your program with different pictures that have brown (e.g. Barbara.jpg). 6.1.3 Reducing Redeye iv) Type in the following code in the Program window below the main method and before the last }: /**