Assignment 3 for CSE 130/DXARTS 198A

Spring Quarter, 2008

Type your answers into a file. This can be a Microsoft Word document, and you can put images into it. Go ahead and include an image for each problem. Turn in your file by uploading it to our CollectIt dropbox and submitting it as Assignment 3. It's due Friday, April 18 at 5:00 PM (Changed from Wednesday). The dropbox is at the UW Catalyst web site, linked from here.
  1. Give a PixelMath formula that will create a gradient of yellow (gradually going from black to yellow, from left to right). Use the RGB color system for this problem.
  2. Design a PixelMath formula that will produce an image with all the following properties: (1) it consists of pixels that are either red, green, or blue; (2) starting at (0, 0) and going to the right, the colors are red, green, blue, red, green, blue, etc. (3) a pair of adjacent pixels (either horizontally or vertically) are never the same color; (4) the image is of size 32 by 32. Hint: Make use of the mod operator. (For a description of the MOD operator, see page 211 of Appendix 1, which is linked from the bottom of the Assignments page.)
  3. Give a formula what will map each color to one with complementary hue and complementary value, but the same saturation. Try this on an image that contains several colors, and describe the effect. Use the HSV color system here.
  4. Give a formula that flips only the right half an image upside down, leaving the left half as it was.
  5. Give a formula that brightens all the pixels in a 100 x 100 box centered in the image, but leaves the other pixels unchanged.
  6. Give a formula that shifts all the pixels in the 100 x 100 box up by 20 pixels, but that shifts all the other pixels left by 30 pixels.
  7. Create a version of the Mona Lisa image in which the color represented by each pixel is a fully saturated version of the original color. Give the formula that accomplishes this.
  8. Create a hue-rotated version of the previous image in which red becomes green, etc. Give the formula that accomplishes this.
Solutions are now available.