Manipulating pixels
Credit Nick Parlente (Stanford) and David Malan (Harvard)
In this quick lab, you're going to manipulate some images at the pixel level to reveal a hidden image. Download these files into the same directory and run main.py
to get started. If all is well, you should see a random blueish image.
The iron-puzzle.png image contains an image of something famous, however 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, set 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). Then multiply each red value by 10, scaling it back up to approximately its proper value. What is the famous object?
Copy your main.py
and edit it for this puzzle. Submit both code files for the lab.
The copper-puzzle.png image also shows something famous, however the image has been distored. The true image is in the blue and green values, however all the blue and green values have all be divided by 20, so the values are very small. The red values are all just random numbers, noise added on top to obscure things. Undo these distortions to reveal the true image. First, set the red values to 0 to get that of the way. You may be able to see the image very faintly at this point, but it is very dark. Then multiply the blue and green values by 20 to get them back approximately to their proper values. What is the famous object?