PATHMac OS 8 Developer Documentation > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Converting Between Color Spaces

Color conversion, which does not require the use of color profiles, is a much simpler process than color matching. The ColorSync Manager provides functions your application can call to convert a list of colors within the same base family--that is, between a base color space and any of its derived color spaces or between two derivatives of the same base family.

You can convert a list of colors between XYZ and any of its derived color spaces, which include L*a*b*, L*u*v*, and Yxy, or between any two of the derived color spaces. You can also convert colors defined in the XYZ color space between CMXYZColor data types in which the color components are expressed as 16-bit unsigned values and CMFixedXYZColor data types in which the colors are expressed as 32-bit signed values.

You can convert a list of colors between RGB, which is the base-additive device-dependent color space, and any of its derived color spaces, such as HLS, HSV, and Gray, or between any two of the derived color spaces.

Note

The color conversion functions do not support conversion of HiFi colors.

Here are brief descriptions of the XYZ color space and its derivative color spaces:

Here are brief descriptions of the RGB color space and its derivative color spaces:

To convert colors from one color space to one of its derived spaces, you don't need to specify source and destination profiles. Instead, you just call the appropriate ColorSync Manager function to convert between the desired color spaces. In cases where you're converting between XYZ and Lab or Luv spaces, a "white reference" is required to perform the conversion. This reference is expressed in the XYZ color space, and provides a way to specify the theoretical illuminant (for example, D65) under which the colors are viewed.

Note

Prior to version 2.1, the ColorSync Manager used a component to implement color conversion. An application had to open a connection to the component with the Component Manager, then pass the component instance as a parameter to the color conversion functions. For example, the CMXYZToLab function performs the same conversion as CMConvertXYZToLab , but takes a first parameter of

ComponentInstance ci

For backward compatibility, component-based color conversion functions such as CMXYZToLab are still supported. However, their use is discouraged, and they are not guaranteed to work in future versions (nor are they documented here).


© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)