Image 10-20-30 Exercises

< Code In The Browser

For these "10-20-30" puzzles, the red, green, and blue values in the images have been divided by one of the numbers: 10, 20, or 30. Experiment to figure out which number goes with which color to recover the original image. The recovered image may have some banding in it, but you should be able to recognize who or what it shows.

The key pattern inside the loop is a line like this:

  pixel.setRed(pixel.getRed() * 10);

The above code multiples the red value of the pixel by 10.

Exercise 1

One color was divided by 10, one by 20, and one by 30. As a first step, simply multiply each color by 10 so you can see what the image is supposed to look like. Then figure out which color needs a 20 multiplier and which needs a 30, so in the end the colors look about right.


Exercise 2


Exercise 3 (optional)


This work was created by Nick Parlante and is released under the Creative Commons Share-Alike license 3.0