next up previous contents index
Next: I.6 Thinking in RGB Up: I. Color Space: The Previous: I.4 Color interpolation   Contents   Index


I.5 Artificial illumination

GMT uses the HSV system to achieve artificial illumination of colored images (e.g. -I option in grdimage) by changing the saturation s and value v coordinates of the color. When the intensity is zero (flat illumination), the data are colored according to the cpt file. If the intensity is non-zero, the color is either lightened or darkened depending on the illumination. The color is first converted to HSV (if necessary) and then darkened by moving ($s$,$v$) toward (HSV_MIN_SATURATION, HSV_MIN_VALUE) if the intensity is negative, or lightened by sliding ($s$,$v$) toward (HSV_MAX_SATURATION, HSV_MAX_VALUE) if the illumination is positive. The extremes of the $s$ and $v$ are defined in the .gmtdefaults4 file and are usually chosen so the corresponding points are nearly black ($s$ = 1, $v$ = 0) and white ($s$ = 0, $v$ = 1). The reason this works is that the HSV system allows movements in color space which correspond more closely to what we mean by ``tint'' and ``shade''; an instruction like ``add white'' is easy in HSV and not so obvious in RGB.


next up previous contents index
Next: I.6 Thinking in RGB Up: I. Color Space: The Previous: I.4 Color interpolation   Contents   Index
Paul Wessel 2008-05-15