Question
Assignment 3 Pixel Tinting! #java #javaProgramming Part 2 Go Dutch! Merge your headshot with a transparent Royal Dutch Navy flag. Part 2 Go Dutch! For
Assignment 3 Pixel Tinting! #java #javaProgramming
Part 2 Go Dutch! Merge your headshot with a transparent Royal Dutch Navy flag.
Part 2 Go Dutch!
For Part 2 of the assignment, you are to use base code Assignment3Part2.java as
a starting point. The objective is to create a program that merges your headshot
with the historical flag of the Royal Dutch Navy:
Hint: Use a while loop to loop through the pixels in your image, tinting the first
third of the pixels orange, the second third of the pixels white, and the last third
of the pixels green. Note that you want to move the RGB values towards orange,
white, or green but not completely because then it would just look like the flag
image above.
In the Main() method, write code that will load in a headshot image called
myHeadShot.jpg (you will have to rename your photo to this). You should
accomplish everything you need to do in the Main() method of
Assignment3Part2.java.
part2 classes..
/* Assignment 3, Part 2 - Go Dutch! */
public class Assignment3Part2
{
//
public static void main(String [] args) throws InterruptedException
{
String filename;
if (args.length > 0) {
// got a filename passed into program as a parameter
// don't change this part of the code needed by TA for grading
filename = args[0];
System.out.println("Filename passed in: " + filename);
} else {
// ask user for a picture
filename = FileChooser.pickAFile();
System.out.println("User picked file: " + filename);
}
Picture pic = new Picture(filename); // Picture to modify
//
pic.show(); // Show the original picture
Thread.sleep(1000); // Pause for 1 second. You can pause for
less if you like
Pixel[] pixelArray = pic.getPixels();
// TODO: put your flag tinting code here
pic.repaint();
} // End of main
} // End of Class
please also check this link for full assigement from part1 to 4.
https://www.chegg.com/homework-help/questions-and-answers/assignment-3-pixel-tinting-java-javaprogramming-part-1-go-psychedelic-make-tinting-animati-q27816810
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started