Abstract:
A method for manipulating color values in a computer graphics system. Colors are mapped into a color space referred to as &#34;HSY space,&#34; which provides independent control over the orthogonal parameters of hue, saturation and luminance. The intuitive color description qualities of hue and saturation are retained in combination with the luminance parameter, which is specifically tuned to the response of the human eye and a specific display system. The present invention thus provides ease of use for the graphic artist without the hue and saturation dependent luminance response of prior art methods. Color image data in HSY format is manipulated by a color graphics editing or rendering process by altering hue, saturation and luminance individually. The graphic artist is thus able to select the appropriate color by using tints, shades and tones. In one embodiment, HSY color data is converted into a second color data format, such as RGB, for display or storage purposes to meet the physical requirements of display devices. A reverse transformation is used to convert scanned image data in RGB format into HSY data for manipulation in HSY space by the editing process. In addition, two hue preserving transformations are described which map the unit HSY color space into the unit RGB color space.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to the field of color editing and display systems. 
     Portions of the disclosure of this patent document contain material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever. 
     2. Background 
     Computer graphics and imaging systems often use color displays as output devices or as a means to view work in progress before generating a color print output. In either case, the color display should provide accurate representation of desired colors. Often, color images are &#34;scanned&#34; into a computer graphics system for manipulation or editing. In other cases, color images are generated or rendered in a computer graphics systems for display. 
     For display purposes, hardware constraints may dictate how colors are represented in the display memory. For instance, a three phosphor display system may store color data as a combination of three phosphor intensity values, such as in a RGB display system. However, for color image editing and manipulation, color representation should be more intuitive to the graphic artist, allowing manipulation of tints, shades and tones. Therefore, in computer graphics and imaging systems, color representation is subject to constraints imposed by the display hardware and by the graphic artist. 
     RGB color is a commonly used color format for graphic display systems. RGB color is based on a &#34;color model&#34; system. A color model allows convenient specification of colors within a color range, such as the RGB (red, green, blue) primary colors. A color model is a specification of a three-dimensional color coordinate system and a three-dimensional subspace or &#34;color space&#34; in the coordinate system within which each displayable color is represented by a point in space. Typically, computer and graphic display systems are three phosphor systems with a red, green and blue phosphor at each pixel location. The intensities of the red, green and blue phosphors are varied so that the combination of the three primary colors results in a desired output color. 
     The RGB color model uses a Cartesian coordinate system. The subspace of interest in this coordinate system is known as the &#34;RGB color cube&#34; and is illustrated in FIG. 1. Each corner of the cube represents a color that is theoretically one-hundred percent pure--that is, the color at that location contains only the color specified, and contains no amount of other colors. In the RGB color cube, the corners are defined to be black, white, red, green, blue, magenta, cyan, and yellow. Red, green and blue are the primary colors, black is the absence of color, white is the combination of all colors, and cyan, magenta and yellow are the complements of red, green and blue. 
     Still referring to FIG. 1, the origin of the coordinate system corresponds to the black corner of the color cube. The cube is a unit cube so that the distance between the origin and adjacent corners is 1. The red corner is thus at location, (1,0,0). The axis between the origin (black) and the red corner is referred to as the red axis 110. 
     The green corner is at location (0,1,0) and the axis 120 between the black origin and the green corner is referred to as the green axis. The blue corner is at location (0,0,1) and the blue axis 130 is the axis between the blue corner and the origin. 
     Cyan is at corner (0,1,1), magenta is at corner (1,0,1) and yellow is at corner (1,1,0). The corner opposite the origin on the cube&#39;s diagonal at location (1,1,1) is the white corner. 
     A color is defined in the color cube by a vector having red, green and blue components. For example, vector 180 is the resultant of vectors 180R, (along the red axis), vector 180G (along the green axis) and vector 180B (along the blue axis). The end point of vector 180 can be described mathematically by 0.25 R+0.50 G+0.75 B. The end of this vector defines a point in color space represented mathematically by sum of its red, green and blue components. 
     An example of a system for displaying RGB color is illustrated in FIG. 2. A refresh buffer 140, also known as a video RAM, or VRAM, is used to store color information for each pixel on a video display, such as CRT display 160. A DRAM can also be used as buffer 140. The VRAM 140 contains one memory location for each pixel location on the display 160. For example, pixel 190 at screen location X 0  Y 0  corresponds to memory location 150 in the VRAM 140. The number of bits stored at each memory location for each display pixel varies depending on the amount of color resolution required. For example, for word processing applications or display of text, two intensity values are acceptable so that only a single bit need be stored at each memory location (since the screen pixel is either &#34;on&#34; or &#34;off&#34;). For color images, however, a plurality of intensities must be definable. For certain high end color graphics applications, it has been found that 24 bits per pixel produces acceptable images. 
     Consider, for example, that in the system of FIG. 2, 24 bits are stored for each display pixel. At memory location 150, there are then 8 bits each for the red, green and blue components of the display pixel. The eight most significant bits of the VRAM memory location could be used to represent the red value, the next 8 bits represent the green value and the 8 least significant bits represent the blue value. Thus, 256 shades each of red, green and blue can be defined in a 24 bit per pixel system. When displaying the pixel at X0, Y0, the bit values at memory location 150 are provided to video driver 170. The bits corresponding to the R component are provided to the R driver, the bits representing the green component are provided to the G driver, and the bits representing the blue component are provided to the blue driver. These drivers activate the red, green and blue phosphors at the pixel location 190. The bit values for each color, red, green and blue, determine the intensity of that color in the display pixel. By varying the intensities of the red, green and blue components, different colors may be produced at that pixel location. 
     Many of the colors that can be defined in the color cube cannot actually be displayed or have differences perceived because of limitations on the responsiveness of the red, green and blue phosphors. One prior art attempt to provide a solution to this problem is to define a color space within the color cube that is optimized for human perception. One such color space is known as the YIQ color space which is used in the commercial color TV broadcasting system known as NTSC (National Television Standards Committee). The YIQ color space is a recoding of the RGB color space for transmission efficiency and also to provide compatibility with black and white television. The YIQ model is a 3D Cartesian coordinate system mapped into the RGB color cube. Transmission efficiency is achieved by reducing bandwidth in I and Q. The RGB to YIQ conversion that performs the mapping is defined by the following matrix equation: ##EQU1## 
     The inverse of the matrix is used for the reverse conversion. The Y axis of the YIQ color model represents the luminance of the display pixel, and matches the luminosity response curve for the human eye. In a black and white receiver, only the Y value is used. In a color receiver, all three axes are used to provide display information. 
     In operation, an image may be recorded with a color camera, which is an RGB system, and converted to YIQ for transmission. At the receiver, the YIQ information is then retransformed into RGB information to drive the color display. 
     Whereas the RGB and YIQ color spaces are defined to meet hardware constraints, a more user-intuitive model is desired that reflects a graphic artist&#39;s feel for tint, shade, and tone. One such color space definition is the HSV color space, which is described along with YIQ color space on pages 613-616 of &#34;Fundamentals of Interactive Computer Graphics,&#34; by J. D. Foley and A. Van Dam, published by Addison-Wesley Publishing Company in 1984. 
     The HSV color space has three parameters (or components): hue, saturation, and value. The HSV color space can be represented by hexagonal cone, as illustrated in FIG. 3, wherein the central axis is the V (value) axis. The apex of the cone is at V=0, and represents black, or (0,0,0) on the RGB cube. The base of the cone is at V=1. The cone may be separated into hexagonal planes (or hexagons) of constant V, e.g., hexagon 300 of FIG. 3. The value for V is calculated from the RGB components by simply taking the maximum value of the RGB components. 
     The saturation parameter S is a ratio, ranging from S=0 at the center of the hexagons (i.e., along the V axis), to S=1 at the edges. The point (S=0, V=1) represents white, and corresponds to (1,1,1) on the RGB cube. Intermediate values of V at S=0 correspond to grays. The value for S is calculated by subtracting the minimum RGB value from the maximum RGB value, and then dividing by the maximum RGB value (or V value): 
     
         S= max(R,G,B)-min(R,G,B)!/max(R,G,B)                        2! 
    
     The hue parameter H determines the pigment content of the color. Hue is measured as the angular rotation about the V axis. Each apex of the hexagons represents either a primary color or a complement of one of the primary colors. To maintain the unitary range of the color model, a full rotation of 360° is equal to one, and a rotation of 180° is equal to one-half. The locations of the primary and complementary colors around the hue arc are red at H=0 (1), yellow at H=1/6, green at H=2/6, cyan at H=3/6, blue at H=4/6 and magenta at H=5/6. Pure pigments are located at the appropriate H value, where V=S=1. The hue value is determined from the RGB components based on which component is the greatest and which is the least. 
     FIG. 5 shows a hue line from H=0 to H=1, delineating the maximum and minimum RGB contributors over the hue range. The range is divided into regions I-VI for calculation of the hue value from the RGB components. These hue regions are bounded on either side by hue values representing the primary and complementary colors. These hue values also represent RGB values wherein two of the three RGB components are equal. (No hue value is indicated for R=G=B, because the associated saturation value is zero, indicating a color along the V-axis where hue is irrelevant.) The minimum and maximum components for the respective regions are outlined in the following table: 
     
                       TABLE 1______________________________________HUE CHARACTERISTICSREGION   HUE RANGE    MINIMUM, MAXIMUM RGB______________________________________I         0-1/6       BLUE, REDII       1/6-2/6      BLUE, GREENIII      2/6-3/6      RED, GREENIV       3/6-4/6      RED, BLUEV        4/6-5/6      GREEN, BLUEVI       5/6-6/6      GREEN, RED______________________________________ 
    
     One method for calculating hue is to determine the hue region containing the color based on the minimum and maximum RGB component values, and then to perform a calculation for the appropriate regional case. At the point where two of the three RGB components are equal, both equations for the adjoining regions will provide the same hue value. One possible set of calculations is given below: 
     
         Region I: H= 1-(R-G)/(R-B)!(1/6)                            3! 
    
     
         Region II: H= 1+(G-R)/(G-B)!(1/6)                           4! 
    
     
         Region III: H= 3-(G-B)/(G-R)!(1/6)                          5! 
    
     
         Region IV: H= 3+(B-G)/(B-R)!(1/6)                           6! 
    
     
         Region V: H= 5-(B-R)/(B-G)!(1/6)                            7! 
    
     
         Region VI: H= 5+(R-B)/(R-G)!(1/6)                           8! 
    
     Under the HSV model, for constant value (V) at constant saturation, the RGB values over the hue range are simply defined. Each R, G and B value is equal to V for the one-third of the hue range centered on its pure pigment hue value (e.g., H=0 for R), equal to the minimum value for the one-third of the hue range centered around the pure complement pigment hue value, and transitioning linearly between the minimum value and V in the remaining portions of the hue range. 
     FIGS. 4A-4C are graphs of the individual RGB component values versus hue at saturation S=1 and value V=1. As shown in FIG. 4A, the red component (R) of the RGB value has a constant value of R=1 from H=0 to H=1/6, and from H=5/6 to H=1. At H=1/6, the red component ramps down to R=0 at H=2/6. R remains constant at R=0 from H=2/6 to H=4/6, then ramps up to R=1 at H=5/6. 
     In FIG. 4B, the green component (G) of the RGB value is G=0 at H=0, but ramps up to G=1 at H=1/6. From H=1/6 to H=3/6, the green component is constant at G=1. Between H=3/6 and H=4/6, the green component ramps down from G=1 to G=0, and from H=4/6 to H=1, the green component remains constant at G=0. 
     In FIG. 4C, the blue component (B) of the RGB value is B=0 from H=0 to H=2/6, then ramps up to B=1 at H=3/6. The blue component remains constant at B=1 from H=3/6 to H=5/6, then ramps down to B=0 at H=1. 
     With the HSV color model, color description and manipulation are user intuitive. For instance, adding black pigment corresponds to decreasing value without changing saturation. Adding white pigment corresponds to decreasing saturation without changing value. Tones can be created by decreasing both saturation and value. Selecting hue corresponds to selecting the pure pigment from which to start. 
     Unfortunately, the prior art intuitive color models, such as HSV, do not account for the luminosity response curve of the human eye. The human eye is far more responsive to light at wavelengths corresponding to green than to light at wavelengths corresponding to red or blue. Because of this, colors with equal value (V) appear more luminous if they are in the green hue region, than if they are in the blue or red region. Value is easily understood from a mathematical standpoint, but far from intuitive for the graphic artist. For instance, on the hue wheel, certain regions of the wheel will appear brighter, despite having a constant value (V). This is undesired from a graphic artist&#39;s standpoint. 
     In general, luminance can be calculated from RGB values as follows: 
     
         Y=k.sub.R (R)+k.sub.G (G)+k.sub.B (B)                       9! 
    
     where k R , k G  and k B  are constants determined by the specific intensities generated by the luminance response of the human eye (called the luminous efficiency function) and the characteristics of a given display system. 
     One definition of k is that used for commercial National Television Standards Committee (NTSC) broadcast video. Here, luminance is defined by the YIQ color space and was based on the display devices currently in use when the standard was written. The coefficient values can be taken from the RGB to YIQ color space transformation: k.sub.(RGB) =(0.298939 0.586625 0.114436). These values are commonly rounded to k.sub.(RGB) =(0.299 0.587 0.114). 
     The International Telecommunications Union (ITU) Recommendation BT. 709, &#34;Basic Parameter Values for the HDTV (High Definition Standard) Standard for the Studio and for International Program Exchange&#34; defines luminance with k.sub.(RGB) =(0.212671 0.715160 0.072169). In any case, the primary driving force in determining the coefficients is the non-uniform response of the human eye to the light in the red, green and blue parts of the spectrum. As a result, the green coefficient, k G , will always be the largest, k R  will be intermediate, and k B  will be the smallest. 
     Applying the NTSC luminosity equation to the RGB values of FIGS. 4A-4C for S=V=1 illustrates the disparity between value (V) and luminance (Y) over the hue range. Table 2 below provides approximate luminance values for the primary and complementary pigment points around the hue wheel. 
     
                       TABLE 2______________________________________HSV LUMINANCE VALUESHUE (H)    LUMINANCE (Y) (@ S=V=1)______________________________________0          k.sub.R1/6        k.sub.R + k.sub.G2/6        k.sub.G3/6        k.sub.G + k.sub.B4/6        k.sub.B5/6        k.sub.B + k.sub.R______________________________________ 
    
     The resulting NTSC luminance versus hue response is shown in FIG. 6. Luminosity is at a maximum around H=1/6 (yellow), and at a minimum around H=4/6 (blue), with luminosity at the maximum being roughly eight times that at the minimum. Further, the waveform is nonlinear, providing difficulty for the graphic artist in predicting luminance behavior. 
     Similarly, luminance is also a function of saturation in HSV space. For instance, at H=0 and V=1, the luminance value at S=0 (R=G=B=1) is k R  +k G  +k B  =1.0, and the luminance value at S=1 (R=1, G=B=0) is k R . The relationship between saturation (S) and luminance (Y) at H=0 and V=1 can be expressed as: 
     
         Y=1-(1-k.sub.R)S                                            10! 
    
     Therefore, for constant hue and value, as saturation is increased, the luminance decreases and the color appears visibly darker. Conversely, as the saturation decreases, the luminance increases and the color appears visibly brighter. 
     Thus, though HSV provides for independent manipulation of hue, saturation and value, the eye of the graphic artist registers an unwanted and non-intuitive dependence between hue and luminance, and saturation and luminance. 
     SUMMARY OF THE INVENTION 
     The present invention provides a method for manipulating color values in a computer graphics system. Colors are mapped into a color space referred to as &#34;HSY space,&#34; which provides independent control over the orthogonal parameters of hue, saturation and luminance. The intuitive color description qualities of hue and saturation are retained in combination with the luminance parameter, which is specifically tuned to the response of the human eye (referred to as the luminous efficiency function) and the characteristics of a given display system. The present invention thus provides ease of use for the graphic artist without the hue and saturation dependent luminance response of prior art methods. 
     In the present invention, color image data in HSY format is manipulated by a color graphics editing or rendering process by altering hue, saturation and luminance individually. The graphic artist is thus able to select the appropriate color by using tints, shades and tones. In one embodiment, HSY color data is converted into a second color data format, such as RGB, for display or storage purposes to meet the physical requirements of display devices. A reverse transformation is used to convert scanned image data in RGB format into HSY data for manipulation in HSY space by the editing process. 
     The unit RGB color space is a subspace of the unit HSY space. Because of this, many RGB values in HSY space are not displayable in standard RGB display units. The present invention provides first and second methods for mapping the unit HSY space into the RGB unit cube, by altering the luminance of the color or by altering the saturation of the color, respectively. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 illustrates an RGB color cube in RGB color space. 
     FIG. 2 is a block diagram illustrating a prior art RGB color display system. 
     FIG. 3 illustrates the hexcone of HSV color space. 
     FIG. 4A is a graph of R versus H for HSV color space at S=V=1. 
     FIG. 4B is a graph of G versus H for HSV color space at S=V=1. 
     FIG. 4C is a graph of B versus H for HSV color space at S=V=1. 
     FIG. 5 is a hue line diagram showing the minimum and maximum RGB components versus hue. 
     FIG. 6 is a graph of NTSC luminance versus hue in HSV color space at S=V=1. 
     FIG. 7A is a graph of R versus H for NTSC HSY color space at S=Y=1. 
     FIG. 7B is a graph of G versus H for NTSC HSY color space at S=Y=1. 
     FIG. 7C is a graph of B versus H for NTSC HSY color space at S=Y=1. 
     FIG. 8 is a graph of luminance versus hue in HSY color space. 
     FIG. 9A is a graph of R in terms of NTSC luminance versus H and S in HSY color space. 
     FIG. 9B is a graph of G in terms of NTSC luminance versus H and S in HSY color space. 
     FIG. 9C is a graph of B in terms of NTSC luminance versus H and S in HSY color space. 
     FIG. 10 is a flow diagram of the RGB to HSY transformation process. 
     FIG. 11 is a flow diagram of the HSY to RGB transformation process. 
     FIG. 12A is a flow diagram of a HSy to RGB transformation for mapping an HSY color into the RGB unit cube. 
     FIG. 12B is a flow diagram of a HsY to RGB transformation for mapping an HSY color into the RGB unit cube. 
     FIG. 13 is a diagram of the cylindrical HSY space. 
     FIG. 14 is a graph illustrating the normalizing process for HSy and HsY space. 
     FIG. 15 is a block diagram of a computer system suitable for implementing the method and apparatus of the present invention. 
     FIG. 16 is an illustration of a graphic user interface for editing and selecting color values. 
     FIG. 17 is a flow diagram of a process for manipulating color values using HSY color data. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     A method and apparatus for providing intuitive manipulation of color data in computer graphics systems is described. In the following description, numerous specific details are set forth in detail to provide a more thorough description of the invention. It will be apparent, however, to one skilled in the art, that this invention can be practiced without these specific details. In other instances, well known features have not been described in detail so as not to unnecessarily obscure the invention. 
     The present invention can be implemented on a general purpose computer such as illustrated in FIG. 15. A keyboard 1510 and mouse 1511 are coupled to a bi-directional system bus 1518. The keyboard and mouse are for introducing user input to the computer system and communicating that user input to central processing unit (CPU) 1513. The computer system of FIG. 15 also includes a video memory 1514, main memory 1515 and mass storage 1512, all coupled to bi-directional system bus 1518 along with keyboard 1510, mouse 1511 and CPU 1513. The mass storage 1512 may include both fixed and removable media, such as magnetic, optical or magnetic optical storage systems or any other available mass storage technology. Bus 1518 may contain, for example, thirty-two address lines for addressing video memory 1514 or main memory 1515. The system bus 1518 also includes, for example, a 32-bit data bus for transferring data between and among the components, such as CPU 1513, main memory 1515, video memory 1514 and mass storage 1512. Alternatively, multiplex data/address lines may be used instead of separate data and address lines. 
     In the preferred embodiment of this invention, the CPU 1513 is a 32-bit microprocessor manufactured by Motorola, such as the 680X0 processor or a microprocessor manufactured by Intel, such as the 80X86, or Pentium processor. However, any other suitable microprocessor or microcomputer may be utilized. Main memory 1515 is comprised of dynamic random access memory (DRAM). Video memory 1514 is a dual-ported video random access memory. One port of the video memory 1514 is coupled to video amplifier 1516. The video amplifier 1516 is used to drive the cathode ray tube (CRT) raster monitor 1517. Video amplifier 1516 is well known in the art and may be implemented by any suitable means. This circuitry converts pixel data stored in video memory 1514 to a raster signal suitable for use by monitor 1517. Monitor 1517 is a type of monitor suitable for displaying graphic images. 
     The computer system described above is for purposes of example only. The present invention may be implemented in any type of computer system or programming or processing environment. 
     In the prior art, color models have been developed to conform to hardware constraints. Such hardware oriented color models are functional for standard display purposes, but provide difficulty for graphic artists wishing to edit scanned or rendered images in the computer. More intuitive models, such as HSV, were developed which applied the intuitive color parameters of hue and saturation to the color space, but provided a third parameter, such as &#34;value,&#34; which was not intuitive to the graphic artist. An important aspect of human vision, perceived brightness, or luminosity, was not considered. Therefore, prior art intuitive models are subject to a perceived dependence between color editing parameters. 
     The present invention provides a color model wherein the three color parameters are orthogonal mathematically and perceptually, providing a mechanism for manipulating color that provides three independent and intuitive parameters for the color space. A software process running in the CPU (central processing unit) of the host computer provides a transformation between the color data (typically RGB) in RAM or VRAM into HSY space for manipulation in an image manipulation program such as a graphics editor or renderer. 
     The color space of the present invention is referred to as HSY space because it provides hue (H) and saturation (S) values, as well as a luminance value (Y). Whereas HSV is described in terms of a hexcone, the HSY space may be represented as a cylindrical space, as shown in FIG. 13, wherein the radial coordinate is saturation, the angular coordinate is hue and the orthogonal central axis is luminance. For each parameter H, S and Y, the range is between zero and one. The unit RGB cube comprises a subspace within this &#34;unit cylinder.&#34; 
     In HSY space, by definition, when saturation is equal to one, the minimum RGB component is zero. Also, when the saturation value is zero, 
     
         R=G=B=luminance (Y).                                        11! 
    
     Further, luminance is defined as: 
     
         Y=k.sub.R (R)+k.sub.G (G)+k.sub.B (B)                       12! 
    
     The definition for hue is illustrated by providing a three dimensional space wherein hue, saturation and the respective R, G or B value form orthogonal axes. The hue and saturation parameters have a range between zero and one. However, to provide luminance with a range of zero to one, RGB values are not constrained between zero and one. Red values have a range between zero and 1/k R , green values have a range between zero and 1/k G , and blue values have a range between zero and 1/k B . 
     FIGS. 7A-7C illustrate the NTSC based definition for hue at S=Y=1. These three figures conform to the hue characteristic behavior of FIG. 5 for minimums and maximums, but are constrained to provide a constant luminance over hue as shown in FIG. 8. The R, G and B values over the hue range are piecewise linear in regions I-VI. Therefore, at S=1, the R, G and B values can be characterized by their respective values at the boundaries of these regions. Values within these regions can be extracted by linearly interpolating between the regional boundary values. The NTSC based boundary values for R, G and B at S=1 are shown in Table 3. 
     
                       TABLE 3______________________________________HSY HUE BOUNDARY VALUES (@ S=1, Y=1)HUE (H)  RED (R)     GREEN (G)  BLUE (B)______________________________________0        1/k.sub.R = 3.34516                0          01/6      1/(k.sub.R + k.sub.G) =                1/(k.sub.R + k.sub.G) =                           0    1.12922     1.129222/6      0           1/k.sub.G = 1.70467                           03/6      0           1/(k.sub.G + k.sub.B) =                           1/(k.sub.G + k.sub.B) =                1.42641    1.426414/6      0           0          1/k.sub.B = 8.738515/6      1/(k.sub.B + k.sub.R) =                0          1/(k.sub.B + k.sub.R) =    2.41911                2.419111        1/k.sub.R = 3.34516                0          0______________________________________ 
    
     For a RGB value at S=1 and Y=1, such as red R&#39;, residing at hue H&#39; within hue values H L  and H H , where H L  is the lower hue boundary value of a hue region and H H  is the upper hue boundary value of the region, and knowing the values of R (R L  and R H ) at the lower and upper boundaries, the following linear equations can be used to calculate R&#39; given H&#39;, or vice versa. 
     
         R&#39;=6 (R.sub.H -R.sub.L)(H&#39;-H.sub.L)!+R.sub.L                 13! 
    
     
         H&#39;=(R&#39;-R.sub.L)/ 6(R.sub.H -R.sub.L)!+H.sub.L                14! 
    
     Similar equations may be derived for blue B&#39; and green G&#39; values. 
     The hue definition at saturation S=0 is defined as R=G=B=Y across the hue range. A series of constant luminance, bilinear surfaces are formed in the three dimensional space by linearly interpolating all R, G and B values over the saturation range based upon their respective values at S=0 and S=1 for the respective hue value. 
     These bilinear surfaces are shown in FIGS. 9A-9C, which show R, G and B component values respectively versus hue and saturation in HSY color space. The RGB components are scaled by NTSC luminance on the vertical axis to illustrate the R, G and B surfaces for all H, S and Y values. However, at zero luminance, the saturation is also zero, and hue is typically set to zero for convenience. 
     RGB to HSY Conversion 
     When data is stored in memory in RGB format, a transformation is required to change RGB values taken from memory into HSY values used for color manipulation. FIG. 10 is a flow diagram of an embodiment of the transformation process for transforming RGB color data into HSY color data. 
     In FIG. 10, the RGB pixel data is read from memory and processed by software as follows. In block 1000, luminance (Y) is calculated directly from the RGB values according to luminance equation  12!. In subsequent block 1001, the luminance value is checked to determine if luminance is effectively zero. This can be computationally performed by comparing luminance (Y) with a very small threshold, such as 0.0001. If the luminance is less than the threshold, then the saturation value S is set to zero in block 1002, and the process moves to block 1005, where the hue value H is also set to zero to complete the transformation. However, if, in block 1001, luminance is not less than the threshold, then, in block 1003, the saturation value is determined from the minimum RGB component value and the luminance value using the following linear equation: 
     
         S=1-min(R,G,B)/Y                                            15! 
    
     Equation  15! results from knowing from the definition for saturation that the minimum RGB component is zero when S=1, and that the minimum RGB component is equal to the luminance value (Y) at S=0. Linear interpolation based on these saturation boundary points produces equation  15!. 
     After the saturation value has been set in block 1003, the saturation value is compared with a minimum threshold in block 1004 to differentiate between zero valued and non-zero valued saturation values. If the saturation value is zero-valued (i.e., less than the minimum threshold), then the process branches to block 1005 to assign a zero hue value. If the saturation value is non-zero (i.e., larger than the minimum threshold), then the appropriate hue region is determined in block 1006 based on the maximum and minimum RGB components. The hue characteristics for this determination are provided in FIG. 5 and Table 1. After the appropriate hue region is determined, in block 1007, the hue value is calculated based on an RGB component value (not the minimum value), and the calculated saturation and luminance values. A computer graphics artist or transparent software process, such as a shading routine, may then manipulate the hue, saturation and luminance of the color data by altering the appropriate HSY component. 
     With respect to blocks 1002 and 1005 of FIG. 10, the assignment of zero values to hue and saturation is performed in initialization situations, e.g., when an RGB value is first transformed into the HSY color space. In a manipulation operation, the saturation and hue values are typically not reset to zero when the luminance value is reduced to a substantially zero value. This prevents a color manipulation process from altering hue and saturation values when the luminance value has been adjusted in the vicinity of zero. For instance, in most applications, one does not typically want to reset the hue from a yellow value to a red value when a luminance control is reduced to zero and then raised again. Such a reset is not necessary in situations where previous hue and saturation data exist. Similarly, hue is not typically reset when the saturation value is varied near zero. 
     Referring to FIGS. 9A-9C, each hue region has unique bilinear surfaces representing the red, green and blue color components as a function of hue, saturation and luminance. These surfaces can be represented by the following regional functions: 
     
         R.sub.I =f.sub.I (H,S,Y)                                    16! 
    
     
         G.sub.I =g.sub.I (H,S,Y)                                    17! 
    
     
         B.sub.I =h.sub.I (H,S,Y)                                    18! 
    
     
         R.sub.II =f.sub.II (H,S,Y)                                  19! 
    
     
         G.sub.II =g.sub.II (H,S,Y)                                  20! 
    
     
         B.sub.II =h.sub.II (H,S,Y)                                  21! 
    
     
         R.sub.VI =f.sub.VI (H,S,Y)                                  22! 
    
     
         G.sub.VI =g.sub.VI (H,S,Y)                                  23! 
    
     
         B.sub.VI =h.sub.VI (H,S,Y)                                  24! 
    
     Solving the above equations for hue provides the following new equations for hue with respect to the respective RGB component for the surface, the saturation value and the luminance value. 
     
         H.sub.I =f&#39;.sub.I (R,S,Y)                                   25! 
    
     
         H.sub.I =g&#39;.sub.I (G,S,Y)                                   26! 
    
     
         H.sub.I =h&#39;.sub.I (B,S,Y)                                   27! 
    
     
         H.sub.VI =f&#39;.sub.VI (R,S,Y)                                 28! 
    
     
         H.sub.VI =g&#39;.sub.VI (G,S,Y)                                 29! 
    
     
         H.sub.VI =h&#39;.sub.VI (B,S,Y)                                 30! 
    
     For each hue region, there are three possible solutions for hue based on the three different RGB components. Looking at the definition for hue, it can be seen that the solution which is a function of the minimum RGB component is not determinative because it is flat with respect to hue, i.e., there is no change in the minimum RGB component as hue changes. This leaves the two remaining functions as possible solutions for calculating hue. For an embodiment utilizing the hue function based on the maximum RGB component, the following functions are used for hue regions I-VI: 
     
         ______________________________________HUE REGION     CHOSEN FUNCTION______________________________________I              H.sub.I = f&#39;.sub.I (R,S,Y)                       31!II             H.sub.II = g&#39;.sub.II (G,S,Y)                       32!III            H.sub.III = g&#39;.sub.III (G,S,Y)                       33!IV             H.sub.IV = h&#39;.sub.IV (B,S,Y)                       34!V              H.sub.V = h&#39;.sub.V (B,S,Y)                       35!VI             H.sub.VI = f&#39;.sub.VI (R,S,Y)                       36!______________________________________ 
    
     To generate the above functions, a linear equation is used to determine the value of the RGB component at S=Y=1. For example, in region I, the R value of the RGB triple is used to determine R S , the red value for the same hue at S=Y=1. 
     
         R.sub.S =(R-Y)/(SY)+1                                       37! 
    
     Combining the above equation with equation  14! yields the following general hue equation: 
     
         H.sub.I =f&#39;.sub.I (R,S,Y)={ (R-Y)/(SY)+1-R.sub.L !/(R.sub.H -R.sub.L)}·(1/6)+H.sub.L                           38! 
    
     Similar equations are derived using linear equations for the remaining regions. Inserting the boundary values for HSY color space from Table 3, the following case set is generated: ##EQU2## 
     It will be obvious to one skilled in the art that similar equations may also be generated relative to H H , rather than H L . 
     A more computationally robust implementation chooses the function for hue in which the bilinear surface representing the given RGB component has an overall slope closest to one. This reduces as much as possible the scale factors (multipliers) and their concomitant potential for increasing roundoff error in the conversion. This is only an issue if fixed point computation of some form is used. Given floating point computations and eight or ten bit quantized RGB values used for display, this scheme is not necessary. 
     It will be obvious that image data can be created and stored in HSY format, and processed without the need for conversion from RGB to HSY color space. The image data is then transformed from HSY space into RGB space when necessary for display purposes. 
     HSY to RGB Conversion 
     HSY image data must be transformed back into RGB for physical display systems requiring RGB data format. Also, transformation may also be required when sending image data to another computer or process that operates only on RGB formats. 
     It will be obvious to one skilled in the art that transformations into non-HSY color spaces other than RGB are possible by transforming data from HSY space into RGB space, and then from RGB space into a third space using known transformations between RGB and the third space. The reverse process can be used to transform data from the third color space into HSY space. Also, using the definitions of each color space in terms of the RGB space, more straightforward transformation schemes for transforming directly between HSY space and a third color space can be mathematically derived without departing from the scope of the invention. 
     FIG. 11 is a flow diagram of a transformation process for converting HSY color data into RGB color data. Given HSY color data (H,S,Y), in block 1100, the RGB component values corresponding to the given hue at S=Y=1 are determined from the hue definition. From equation  13!, 
     
         (R,G,B).sub.(H,1,1) =(6 (R.sub.H -R.sub.L)(H-H.sub.L)!+R.sub.L, 
    
     
         6 (G.sub.H -G.sub.L)(H-H.sub.L)!+G.sub.L, 
    
     
         6 (B.sub.H -B.sub.L)(H-H.sub.L)!+B.sub.L)                   45! 
    
     Applying the appropriate boundary values from Table 3 to equation  45! yields the appropriate RGB value at S=Y=1. 
     In block 1101, the RGB component values corresponding to the given hue at S=0, Y=1 are determined. From the definitions for HSY space, R=G=B=Y at saturation equals zero. Therefore, 
     
         (R,G,B).sub.(H,0,1) =(Y,Y,Y)=(1,1,1)                        46! 
    
     In block 1102, the RGB component values corresponding to the given hue and saturation at Y=1 are determined by interpolating between the values determined in blocks 1100 and 1101. From the linear behavior across saturation, the following equation is generated. ##EQU3## 
     Finally, because luminance is linear in RGB, in block 1103, the RGB component values determined from equation  47! in block 1102 are scaled by the luminance to provide the RGB value for the given hue, saturation and luminance. I.e., 
     
         (R,G,B).sub.(H,S,Y) =Y·(R,G,B).sub.(H,S,1)          48! 
    
     For many purposes, the RGB value calculated in equation  48! is the final RGB value, and may be displayed as generated. However, because the RGB unit cube is only a subspace of the unit HSY color space, it is possible for some HSY values to exist outside of the RGB unit cube after the HSY to RGB transformation is completed. For instance, (4/6,1,1) in NTSC based HSY space corresponds to (0,0,8.74) in RGB space. 
     Two methods for mapping the HSY color space within the RGB unit cube are provided below. The first method, referred to as HSy space, normalizes the luminance value to guarantee that the resulting RGB value resides in the RGB unit cube. The second method, referred to as HsY space, normalizes the saturation value to provide an RGB value within the RGB unit cube. Upper case letters indicate un-normalized components, whereas lower case letters indicate normalized components. 
     FIG. 14 is a graph of the maximum RGB component value versus saturation, illustrating how either the saturation value or the luminance value is normalized to bound the maximum RGB component value. A dashed line corresponding to  max(R,G,B)=1! indicates the maximum displayable RGB component value. A solid line containing the points (0,Y), (S&#39;,1) (labeled point &#34;B&#34;) and (S,max (RGB).sub.(H,S,Y) !) (labeled as point &#34;A&#34;) indicates the constant luminance, constant hue line containing the RGB value. 
     The normalization of luminance for HSy conversion to RGB is performed by mapping point A into point C while maintaining constant hue and saturation. The new constant luminance surface containing point C, since luminance is linear in RGB, has a normalized luminance value Y&#39; given below: 
     
         Y&#39;=Y· 1/max(R,G,B).sub.(H,S,Y) !                   49! 
    
     The mapping function of HSy space is thus: 
     
         If max (R,G,B).sub.(H,S,Y) !&gt;1 
    
     
         then (R,G,B).sub.(H,S,Y)= 1/max(R,G,B).sub.(H,S,y) !·(R,G,B).sub.(H,S,Y)                              50! 
    
     
         else (R,G,B).sub.(H,S,y) =(R,G,B).sub.(H,S,Y)                51! 
    
     The normalization of saturation for HsY conversion to RGB is performed by mapping point A into point B while maintaining constant hue and luminance. A normalized saturation value S&#39; is obtained where the constant luminance surface of the max (R,G,B).sub.(H,S,Y) ! component is equal to one. Using the linear nature of the constant luminance surface, the normalized saturation value is calculated as follows: 
     
         S&#39;=S(1-Y)/ max(R,G,B).sub.(H,S,Y) -Y!                       52! 
    
     Using the values H, S&#39; and Y, the conversion process to RGB is repeated to obtain a displayable RGB value. The mapping function for HsY space is thus: ##EQU4## 
     FIG. 12A shows the transformation process for conversion from HSy to RGB. The transformation from HSy space into RGB space is identical to the standard HSY to RGB transformation except for an additional normalization step after block 1103. The RGB value generated in block 1103 of FIG. 11 is passed to block 1200. In block 1200, the maximum RGB component is compared to one. If, in block 1200, the maximum RGB component value is not greater than one, then the RGB value calculated in block 1103 is maintained. However, if the maximum RGB component value is larger than one, then, in block 1201, all RGB component values are scaled by the reciprocal of the maximum RGB component value, effectively normalizing luminance to the maximum value that generates a displayable RGB value for the given hue and saturation. 
     FIG. 12B shows the transformation process for conversion from HsY to RGB. The transformation from HsY space into RGB space is identical to the standard HSY to RGB transformation through block 1103. The RGB value generated in block 1103 of FIG. 11 is passed to block 1202. In block 1202, the maximum RGB component value is compared to one. If the maximum RGB component value is not greater than one, then the RGB value calculated in block 1103 is maintained. However, if the maximum RGB component value is larger than one, then, in block 1203, a normalized saturation value S&#39; is calculated per equation  52! above. Using the normalized saturation value, the process returns to block 1102 to recalculate the RGB value. 
     In practice, the extra steps needed for HsY conversion are combined into the steps of blocks 1100 through 1103 for coding efficiency. 
     The transformation routines are incorporated in a color editing or graphics editing program such as PHOTOSHOP, or a rendering program such as RENDERMAN, or other suitable software program. Manipulation of color values once the color value is transformed into HSY space may be performed through a user-interactive interface. Also, manipulation of color values may be internal to the software process wherein the hue, saturation and luminance values are altered by the graphics application in a manner transparent to the user, such as in a shading process. One example of a software program implementing HSY transformations is the UNIX tool called &#34;hsytool.&#34; &#34;Hsytool&#34; provides a user-interactive HSY/RGB color selection tool for Silicon Graphics, Inc. (SGI) workstations. 
     &#34;Hsytool&#34; is an interactive graphical tool which allows for color selection using a &#34;mouse.&#34; When the program is started, a window is &#34;opened&#34; (i.e., displayed) on the graphic display device as shown in FIG. 16. The window (1600) contains six controls, one each for hue (H), saturation (S) and luminance (Y) (the coordinates of HSY color space), and one each for red (R), green (G) and blue (B) (the coordinates for RGB color space). 
     Hue control 1601 is a circular dial, sometimes referred to as a hue wheel or color wheel. The color values depicted in the circular dial are those values obtainable by varying the hue parameter only (i.e., maintaining constant saturation and luminance) of the current color value. The display corresponds to the constant saturation and constant luminance circle about the luminance axis in HSY color space which contains the current color value. 
     Saturation control 1602 is a horizontal slider, meaning that it is a strip of constant hue and constant luminance color values varying from a saturation value of zero (gray tone) at one end to a saturation value of one at the opposite end of the strip. The strip corresponds to the constant hue and constant luminance line containing the current color value which originates at the central luminance axis and ends at the edge of the unity valued cylinder in HSY color space. 
     Luminance control 1603 is a vertical slider of constant hue and constant saturation color values varying from a luminance value of zero (black) at the bottom to a luminance value of one at the top of the strip. The strip corresponds to the constant hue and constant saturation line containing the current color value which originates at the bottom of the cylinder and extends parallel to the center axis to the top of the cylinder in HSY color space. 
     Red control 1604, green control 1605 and blue control 1606 are also vertical sliders. Each slider displays the color values obtainable by varying the respective RGB value from zero at the bottom of the strip to one at the top, while maintaining the remaining RGB parameters at constant values. 
     Color values in the hue wheel, saturation strip and luminance strip which correspond to RGB values outside of the unit RGB cube are indicated by a red color value. Alternatively, appropriate HSy or HsY color values may be shown. 
     At any given time, &#34;hsytool&#34; has a single current color which is displayed in square swatch 1607 in the lower left corner of window 1600. The HSY and RGB coordinates of the current color are shown numerically in the center of hue control (color wheel) 1601. These coordinates correspond to the current settings of the six controls (H, S, Y, R, G and B). Short line segments 1608 across each control in contrasting color are provided as control indicators for indicating the same coordinates in analog form. An indicator (1609) in the upper left corner of window 1600 indicates whether the current color value is &#34;safe&#34; for use in NTSC broadcast video (i.e., whether the color value is in the color space that NTSC video can reproduce). 
     A control setting is changed by either clicking the left mouse button while the mouse cursor is on the desired color value inside the control, or by &#34;dragging&#34; the control indicator with the left button held down beginning with the mouse cursor inside the control. If any one of the HSY coordinates are changed, all three RGB coordinates typically change. Similarly, if any one of the RGB coordinates are changed, all three HSY coordinates typically change. 
     Once the desired color value has been selected as the current color value, pressing the &#34;Edit&#34; button in menu bar 1610 will pull down a menu which allows for the current HSY or RGB coordinates to be &#34;cut out.&#34; This places the color coordinates in the window system&#39;s cut buffer, allowing the color coordinates to be inserted or &#34;pasted&#34; in a shell window by clicking on the middle mouse button in the shell window. A user can edit a model, shader, C program or other text file and insert a color value selected with &#34;hsytool.&#34; The inverse operation is also possible. Color coordinates can be cut out from a model, shader, C program or other text file and &#34;pasted&#34; into &#34;hsytool&#34; using one of the commands in the &#34;Edit&#34; menu. 
     In &#34;hsytool,&#34; colors displayed outside of window 1600 (elsewhere on the screen) are selected by placing the mouse cursor in window 1600, but not in one of the color controls. Then, the left mouse button is depressed while the mouse cursor is moved outside of window 1600 to the location of the pixel containing the desired color value. When the left mouse button is released, &#34;hsytool&#34; reads the color value for the selected pixel and sets all of the HSY and RGB coordinates to reflect the new current color. 
     In window 1600 of FIG. 16, twelve small colored squares (1611), called &#34;palette squares&#34;, are displayed beside the current color swatch 1607. Initially, these squares are black. Each square can save and restore a particular color value. To save the current color by storing it in a palette square, the middle mouse button is clicked while the mouse cursor is above a palette square. The selected palette square is then filled with the current color. To set the current color to the color of a palette square, the left mouse button is clicked while the mouse cursor is above the chosen palette square. 
     FIG. 17 is a flow diagram of the color manipulation process provided by graphic rendering, color image editing, and color picking/editing programs such as &#34;hsytool.&#34; FIG. 17 illustrates a process for manipulating a color value initially provided as either HSY color data or as color data in a non-HSY format such as RGB. The resulting color value thus generated can then be stored in the computer system memory as color data in either HSY or non-HSY format. The color data can originate from or be placed into models, shaders, image files, text files or other graphics files (collectively referred to herein as &#34;image scenes&#34;) in mass storage or main memory. The color data can also be generated from or placed into an active palette as in &#34;hsytool.&#34; Use of a cut buffer or similar means to &#34;cut&#34; and &#34;paste&#34; color data between files and open applications has also been described with respect to &#34;hsytool.&#34; 
     Blocks 1700 and 1701 represent color data input blocks for HSY color data and non-HSY color data, respectively. In block 1700, HSY color data representing a first color value is read from the computer system memory and stored in the color manipulation program&#39;s active memory. Block 1700 then leads to block 1703. In block 1701, RGB or other non-HSY color data is read from the computer system memory into the color manipulation program&#39;s active memory in main memory (i.e., RAM) for processing. In subsequent block 1702, the RGB data is transformed using the RGB-to-HSY transformation routine or the equivalent non-HSY-to-HSY routine to provide corresponding HSY color data that is stored in the program&#39;s active memory. Block 1702 leads to block 1703. 
     In block 1703, a graphic artist may interact with the color manipulation program, using independent controls such as provided in &#34;hsytool,&#34; to alter the hue, saturation and luminance values as desired. User input in the form of keyboard keystrokes or mouse interaction are translated into changes in the respective stored hue, saturation and luminance data in the program&#39;s active memory. Alternatively, the color manipulation program may perform manipulation of the color data in a manner transparent to the user, such as by modifying luminance of color values associated with a textured model in accordance with a shading routine. 
     The new HSY color data from block 1703 is then stored in memory as shown in block 1704, or processed by an HSY-to-RGB transformation routine (or equivalent HsY and HSy routines) to generate new RGB or other non-HSY color data, as shown in block 1705. From block 1705, the process progresses to block 1706 wherein the new RGB color data is placed in memory. Writing the new color data to memory may consist of writing the new color data over the original color data, or of writing the new color data to a new location in memory, such as in a new image file. Color data in display format may be written to video memory for display, such as on a CRT. 
     Color selection and color alteration, such as provided by &#34;hsytool,&#34; are two very important uses of the HSY color space. Because luminance is preserved, the hue and saturation of an image can be altered as desired without affecting the overall brightness of the image. This is useful for graphic art and computer generated imagery. 
     In graphic art, an RGB image to be used in a piece of artwork is transformed into the HSY color space and the hue is altered to suit the color palette of the artwork or the art director. Saturation can also be altered to &#34;punch up&#34; or &#34;tone down&#34; the color density. Luminance can be altered to brighten or darken the artwork. 
     In computer generated imagery or rendering, the same operations can be performed on texture maps that are applied to the surfaces of three dimensional objects. For more flexibility, the shader code used to apply a texture map to a three dimensional object can incorporate the HSY color space transformations--shifting and scaling hue, saturation and luminance--as controlled by a set of parameters set by the lighting or shading directors to change the color, &#34;punch up&#34; or &#34;tone down&#34; the color, or alter the brightness of the texture mapped object without any interaction between these adjustments. The independent nature of the color adjustments provided by the HSY color space greatly reduces the time required to perform these kinds of color alterations. 
     An example of C-language computer code routines for performing HSY/RGB transformations is included as &#34;hsy-xfrms.c&#34; in Appendix 1. 
     An example of C-language computer code for implementing color value manipulation in HSY space as described for &#34;hsytool&#34; is provided as &#34;hsytool.c&#34; in Appendix 2. 
     Thus, a method and apparatus for manipulating color values in a computer graphics system has been described. ##SPC1##