## Image Collage

 Summary Image Collage – create a collage of images. Modify a picture at least 3-4 times using different image methods like negate, clear blue, and scale, and copy each resulting picture to a blank picture. Mirror the results from top to bottom (copy pixels from the top to the bottom of the collage). Topics Mathematical operations, Creating objects, Invoking Methods, Writing methods, Reusing methods, 1D arrays, 2D arrays, Nested for loops Audience CS1 or early in CS2 Difficulty Intermediate, Can take 1-4 weeks for a CS student or longer depending on how many image manipulations you want the students to do in the collage. You can make this shorter by giving them code for some of the picture methods. Strengths This assignment is open-ended and allows for students to be creative with their own pictures. Many love creating collages. Often it is the first time they really want to design a solution. It shows students the value of writing reusable methods. It also shows students the value of arrays and iteration. Weaknesses Some students get frustrated that they can't make the collage look the way they want. Some spend too much time on it. It can be hard to get students to stop working on the collages. Dependencies You will need our Picture class and other classes from the bookClasses directory. You can get these at http://coweb.cc.gatech.edu/mediaComp-plan/101 Variants You can create sound collages with only 1d arrays. You can make a photoshop-type application. You can use our Turtle class to drop rotated pictures on the collage. Exercise Summary Start with our Picture class which gives you a way to get a 1D array of Pixel objects with the method getPixels. You can use getRed, getGreen, and getBlue methods to get the red, green, and blue color values for the Pixel. You can use setRed, setGreen, and setBlue methods to set the Color values at the Pixel. You can also use getColor and setColor using a normal java.awt.Color object. Create methods to negate, reduce red, clear blue, and grayscale the picture using a simple loop (for-each, while, and/or for). Next, show how to loop while keeping track of the x and y values for the Pixels using a nested for loop. Use the getPixel(x,y) method to get the Pixel object for particular x and y values. Have students write methods to copy one picture to another, copy part of one picture to another, mirror a picture horizontally, mirror a picture vertically, rotate a picture, and scale a picture. Now have them write a method to create an image collage using the methods they have written in the Picture class. Additional Materials There are powerpoint slides on working with the Picture class which you can get from http://coweb.cc.gatech.edu/mediaComp-plan/101. A sample syllabus is at http://coweb.cc.gatech.edu/ice-gt/274. Our book was published in 2006. See http://www.amazon.com/gp/product/0131496980/sr=8-1/qid=1155226663/ref=pd_bbs_1/002-9257824-6831248?ie=UTF8