Next: I.4 Color interpolation Up: I. Color Space: The Previous: I.2 HSV color system Contents Index

# I.3 The color cube

We are going to try to give you a geometric picture of color mixing in RGB and HSV by means of a tour of the RGB cube depicted in Figure 7.11. The geometric picture is most helpful, we think, since HSV are not orthogonal coordinates and not found from RGB by a simple algebraic transformation. So here goes: Look at the cube face with black, red, magenta, and blue corners. This is the = 0 face. Orient the cube so that you are looking at this face with black in the lower left corner. Now imagine a right-handed cartesian (,,) coordinate system with origin at the black point; you are looking at the plane with increasing to your right, increasing away from you, and increasing up. Keep this sense of (,,) as you look at the cube.

Now tip the cube such that the black corner faces down and the white corner up. When looking from the top, you can see the hue, contoured in gray solid lines, running around in 360° counter-clockwise. It starts with shades of red (0°), then goes through green (120°) and blue (240°), back to red.

On the three faces that are now on the lower side (with the white print) one of (,,) is equal to 0. These three faces meet at the black corner, where . On these three faces the colors are fully saturated: = 1. The dashed white lines indicate different levels of , ranging from 0 to 1 with contours every 0.1.

On the upper three faces (with the black print), one of (,,) is equal to the maximum value. These three faces meet at the white corner, where . On these three faces value is at its maximum: = 1 (or 100%). The dashed black lines indicate varying levels of saturation: ranges from 0 to 1 with contours every 0.1.

Now turn the cube around on its vertical axis (running from the black to the white corner). Along the six edges that zigzag around the ``equator'', both saturation and value are maximum, so . Twirling the cube around and tracing the zigzag, you will visit six of the eight corners of the cube, with changing hue (): red (0°), yellow (60°), green (120°), cyan (180°), blue (240°), and magenta (300°). Three of these are the RGB colors; the other three are the CMY colors which are the complement of RGB and are used in many color hardcopy devices (see below). The only cube corners you did not visit on this path are the black and white corners. They lie on the vertical axis where hue is undefined and . Any point on this axis is a shade of gray.

Let us call the points where (points along the RYGCBM path described above) the ``pure'' colors. If we start at a pure color and we want to whiten it, we can keep constant and while decreasing ; this will move us along one of the cube faces toward the white point. If we start at a pure color and we want to blacken it, we can keep constant and while decreasing ; this will move us along one of the cube faces toward the black point. Any point in (,,) space which can be thought of as a mixture of pure color + white, or pure color + black, is on a face of the cube.

The points in the interior of the cube are a little harder to describe. The definition for above works at all points in (non-gray) (,,) space, but so far we have only looked at (, ) on the cube faces, not inside it. At interior points, none of (,,) is equal to either 0 or 255. Choose such a point, not on the gray axis. Now draw a line through your point so that the line intersects the gray axis and also intersects the RYGCBM path of edges somewhere. It is always possible to construct this line, and all points on this line have the same hue. This construction shows that any point in RGB space can be thought of as a mixture of a pure color plus a shade of gray. If we move along this line away from the gray axis toward the pure color, we are ``purifying'' the color by ``removing gray''; this move increases the color's saturation. When we get to the point where we cannot remove any more gray, at least one of (,,) will have become zero and the color is now fully saturated; . Conversely, any point on the gray axis is completely undersaturated, so that there. Now we see that the black point is special, is both 0 and 1 at the same time. In other words, at the black point saturation in undefined (and so is hue). The convention is to use at this point.

It remains to define value. To do so, try this: Take your point in RGB space and construct a line through it so that this line goes through the black point; produce this line from black past your point until it hits a face on which . All points on this line have the same hue. Note that this line and the line we made in the previous paragraph are both contained in the plane whose hue is constant. These two lines meet at some arbitrary angle which varies depending on which point you chose. Thus HSV is not an orthogonal coordinate system. If the line you made in the previous paragraph happened to touch the gray axis at the black point, then these two lines are the same line, which is why the black point is special. Now, the line we made in this paragraph illustrates the following: If your chosen point is not already at the end of the line, where , then it is possible to move along the line in that direction so as to increase (,,) while keeping the same hue. The effect this has on a color monitor is to make the color more ``brilliant'', your hue will become ``stronger''; if you are already on a plane where at least one of (,,) = 255, then you cannot get a stronger version of the same hue. Thus, measures brilliance or strength. Note that it is not quite true to say that measures distance away from the black point, because is not equal to .

Another representation of the HSV space is the color cone illustrated in Figure I.3.

Figure I.3: The HSV color space.

Next: I.4 Color interpolation Up: I. Color Space: The Previous: I.2 HSV color system Contents Index