Collage Lab
The goal of this lab is for you to apply creatively the filters and transformations that you have developed throughout this unit.
-
commit to GitHub, at least daily, with a meaningful commit message describing what you accomplished and what needs to be done next
-
create a new class, Collage, with a static main method that will create the collage
-
collage contains at least 4 copies of the image
-
the 4 copies includes the original image and at least 3 modifications of the original image
-
you may find it convenient to start with a large, blank picture Picture canvas = new Picture(height, width);
-
you must invoke the cropAndCopy method that you wrote in the previous programming activity
-
-
modifications must include one or more filters (changing colors) that you implemented and one or more transformations (scaling, mirroring) that you implemented
-
the collage must be saved as an image file, by default it will be saved in the images folder:
-
canvas.write("YourName.jpg");
-
this code doesn't work for some students for unknown reasons. You may need to specify an absolute path. The following are just examples, you will have to adjust them for your specific computer. For example on Windows:
- canvas.write("C:\Users\gschmit\GitHub\media-computation-gcschmit\images\Schmit.jpg");
-
on macOS:
- canvas.write("/Users/gschmit/Documents/GitHub/media-computation-gcschmit/images/Schmit.jpg");
-
on ChromeOS:
-
In the Files app, navigate to the images folder. Right-click on the images folder and select "open in Terminal". Once the Terminal launches, enter the command "pwd". That is the path to the images folder to use in place of my example.
-
canvas.write("/home/gschmit/GitHub/media-computation-gcschmit/images/Schmit.jpg");
-
-
-
Add more copies.
-
Add more filters
-
sepia:
-
convert to grayscale
-
if red < 60 then reduce all three components to 90% of their original value
-
else if red < 190 then reduce just blue to 80% of its original value
-
else reduce just blue to 90% of its original value
-
-
posterize
-
set all color component values in a range to one value (the midpoint of the range)
-
try with four ranges for each color (0-63, 64-127, 128-191, 192-255)
-
-
customizable posterize
- posterize with parameter that specifies how many bins to create (try 8 colors)
-
edge detection
-
calculate the average color for the current pixel and the pixel at the same x but y+1 (Pixel has a getAverage method)
-
get the distance between the two averages
-
if the absolute value of the distance is greater than some value, then turn the current pixel black (Pixel has a colorDistance method) otherwise, turn the current pixel white
-
-
edge detection 2
- edge detection but with calculation based on pixel to the right
-
pixelate
-
Sobel Operator to detect edges of an image
-
sine wave filter (sample code in Processing)
-
geometric primitives (warning: this is crazy hard but looks awesome)
-
read the paper, "A Neural Algorithm of Artistic Style" and browse the associated code
-
-
Add more transformations
-
90° rotation
-
arbitrary rotation
-
geometric inversion (way cool math here)
-
-
Add More Awesome.
-
Submit a link to your GitHub repository with this assignment.
-
If you would like your Collage Lab featured on the school TVs, take a screenshot of your image and add it to the shared Google slide deck based on the provided template slide.