CS 248 - Introduction to Computer Graphics
Autumn Quarter, 2008
Marc Levoy
Handout #4
Option 1 might be called "interpolation in RGB space." It is the default interpolation method using in most commercial paint programs that offer an "airbrush" tool. In the formulas, CR, CG, and CB refer to the old, then the new, pixel color in the canvas, and newcolorR, newcolorG, and newcolorB refer to the brush color.
Option 2 might be called "interpolation in HSV space." Since straight lines in RGB space are not straight in an HSV space, interpolating in HSV produces a different effect than interpolating in RGB. The exact difference depends on which HSV space is chosen. For example, linearly interpolating halfway from pure red, which is (R,G,B) = (255,0,0) (assuming 8-bit values), to pure green, which is (0,255,0), yields (128,128,0), which is a dark yellow. Using the single-hexcone HSV space described in section 13.3.4 of the textbook, pure red is (H,S,V) = (0o,1,1), and pure green is (120o,1,1). Interpolating halfway between them yields (60o,1,1), or (255,255,0) in RGB space, which is pure yellow. This is the interpolation method we are asking you to implement in project #1.
Option 3 might be called "interpolation in RGB space with per-pixel replacement of HSV components." It is used by some commercial paint programs that support hue-only, saturation-only, or value-only airbrushing. (Photoshop calls these components "hue", "saturation", and "luminosity".)