A few examples of paint brushes

CS 248 - Introduction to Computer Graphics
Autumn Quarter, 2003
Marc Levoy
Handout #4









In the three options above, when it says "do (or replace) 1 or more of", those components that are not selected should remain unchanged. In other words, leave them as you found them in the canvas; don't set them to the brush color. (In the project handout, the word "coordinate" is used instead of component.)

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".) Implementing this option (in addition to option 2) will earn you extra credit in project #1; see the project handout.



Note: In the rules above, C0 means means C-zero continuity. The goal of these rules is to simulate painting with an airbrush (think spray can), in the sense that paint is applied more heavily in the center than at the edges of the mask, and you don't see either the edges of the mask or its discrete nature. Of couse, your mask will be a sampled approximation of the smooth functions shown above, so some discretization is unavoidable.


levoy@cs.stanford.edu
Copyright © 2003 Marc Levoy
Last update: October 3, 2004 03:13:14 PM