Programming Drill #8

Due: Tuesday, June 3
Goal:  Loop through pixels in an image
(edited from a nifty assignment by Nick Parlante)

The image named iron-puzzle.png above is a puzzle.  Right-click and save it to the same folder as your Java program (if you use NetBeans, put it in the main project folder). It contains an image of something famous, but the image has been distorted. The famous object is in the red values, however the red values have all been divided by 10, so they are too small by a factor of 10. The blue and green values are all just meaningless random values ("noise") added to obscure the real image. You must undo these distortions to reveal the real image.

First, write a program that loops through all of the pixels and sets all the blue and green values to 0 to get them out of the way. Look at the result .. if you look very carefully, you may see the real image, although it is very very dark (way down towards 0).

Next, modify the program so you multiply each red value by 10, which will scale it back up to approximately its proper value. What is the famous object?