RU beehive logo ITEC dept promo banner
ITEC 120
2009spring
ibarland
nokie
jmdymacek

homeinfolectslabsexamshws
textbooktutor/PIsjava.lang docsjava.util docs

lab14a
2-D arrays
processing pictures II

We will continue working on lab13b.

Review

Review, on processing a 2-D array: a helper method, vs. a nested loop:


More Ideas

If you want more ideas of photoshop effects, there are plenty more ideas. Try any of these, if they grab your fancy:

Color effects

  1. Make method filterPurple which keeps the red and blue components of an image, but sets the green component of each pixel to zero.
  2. Make method invert, similar to filterRed, which complements each component: a color of red=0,green=10,blue=254 would be replaced with a color of red=255,green=245,blue=1.
  3. Make method toBlackAndWhite, which replaces each pixel with the average of the three components. That is, a color of red=0,green=10,blue=80 would be replaced with a color of red=30,green=30,blue=30.
  4. We can also combine two pictures in various ways:
    Superimpose one small picture on top of another.
    Or, take the average of two pictures, to create a third.
    Best: for any double p in 0..1, blend two pictures by adding p times each pixel from the first picture, plus (1-p) times each pixel for the second picture. (If you were make a movie where p varied from 0 to 1, you'd have a continuous fade from one picture to another.)
  5. Greenscreen -- Take a picture of yoruself against a solid green background1 Now, copy all non-green pixels in that picture onto a picture of (say) the moon. Voila, we now have a pciture of you on the moon!
  6. Take any two other effects you've written, and make a method which applies both of them. (Does the order matter? That is, if you filterRed and then convert to black and white, is that the same as converting to black and white and then filtering out the red?)
  7. Write a method filterRight which is like FilterRed except that it only filters the right half (or, the bottom half) of the image.
  8. Write a method which adds colorful diagonal slashes at random.
  9. (This can be difficult. Don't attempt this until you have written edgy.)
  10. Red-eye reduction (more difficult).
    First, by hand, find some pictures that have red-eye in them, and try to detect what RGB values the eyes have. Then write a filter to try to detect and ameliorate such colors in actual photographs.
    (A professional application might even try to detect circles in the input image, but that's a lot tougher.)
  11. Write a method which applies one of your effects just to a circle in the middle of the picture (with, say, a radius of 20 pixels).
    Hint: As before, still call the pixel-changing method on every single location, but have that method only do its work if it is within 20 pixels of the image's center.
  12. See if you can find on the web, how to make an effect replicating sepia (old-timey) photographs, and implement that.
  13. Surprise me!

For each of the above effects, it's interesting to wonder:

The answers of course vary for the different choices of effects.


1 The only reason green screens are used is that bright greens rarely occur otherwise (say in your face or clothing), so it makes it easy to tell the subject from the background.      

homeinfolectslabsexamshws
textbooktutor/PIsjava.lang docsjava.util docs


©2009, Ian Barland, Radford University
Last modified 2009.May.06 (Wed)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme