June 93 - PRINT HINTS
PRINT HINTS
SYNCING UP WITH COLORSYNC
JOHN WANG
Apple's recently introduced ColorSync, a color matching software technology, provides
a common platform for applications and device drivers to match colors by
communicating color information between graphics devices with differing color
characteristics. This column starts off with an overview and then delves deeper into
the inner workings of ColorSync so that you'll have a better understanding of how to
use this new technology. We'll also take a look at how applications and device drivers
can take advantage of ColorSync.
WHAT IS COLORSYNC?
ColorSync is an extension to the Macintosh system that's distributed with the Apple
Color Printer and the Color OneScanner. It provides a platform for maintaining quality
and similarity of images that are moved between different devices. Because different
devices typically reproduce different gamuts -- ranges of colors -- ColorSync can be
used by applications and device drivers to perform color correction. For example,
monitors from different manufacturers have dissimilar gamuts because they use
different hardware that drives different cathode ray tubes. In fact, there are minute
color differences among the same models due to the video card, internal settings, user
adjustments, and even age. ColorSync uses color matching algorithms to visually
equate the images produced by different devices. Applications that are ColorSync aware
attempt to display a document faithfully on any monitor.
Besides supporting RGB, ColorSync supports color matching with other color spaces,
such as CMYK. Printers normally work in the CMYK color space because CMYK colors
are subtractive -- when added they move the image toward black or dark gray. This is
entirely different from RGB monitors, which use additive colors -- colors that when
added move the image toward white. Consequently, ColorSync is especially useful
when it's necessary to match on-screen and printed colors -- colors with two very
different gamuts.
PROFILES AND COLOR MATCHING METHODS
ColorSync uses two major elements to implement color matching between devices:
profiles and color matching methods (CMMs). The profiles contain the device
characterization while the CMMs contain the color matching code to perform the
matching. A CMM performs matching between a source profile and a destination
profile. A system will have at least one profile for each device to be matched and at
least one CMM to perform the matching. Apple ships ColorSync with one Apple CMM
and with ColorSync profiles for all Apple monitors currently being manufactured. The
open architecture of ColorSync allows third-party developers to create their own
profiles and CMMs.
A ColorSync profile is simply a file whose data fork contains a CMProfile record,
usually stored in the ColorSyncTM Profiles folder. (This folder is in the Preferences
folder in your System Folder; your code can get it by calling GetColorSyncFolderSpec.)
Profiles may also be stored in a 'prof' resource,as discussed later. A device may have
more than one profile; however, only one is selected for use at any given time. For
example, printers have profiles for various paper types since the output onto
different types of paper can vary. The Apple Color Printer has default profiles for
coated paper, transparency film, and plain paper. A monitor may also have several
profiles for various special gamma settings. ColorSync neither affects nor is affected
by the gamma setting. For best results, the user must select a ColorSync profile that
matches the gamma.
Here's the data structure for a CMProfile record:
typedef struct CMHeader {
unsigned long size;
OSType CMMType;
unsigned long applProfileVersion;
OSType dataType;
OSType deviceType;
OSType deviceManufacturer;
unsigned long deviceModel;
unsigned long deviceAttributes[2];
unsigned long profileNameOffset;
unsigned long customDataOffset;
CMMatchFlag flags;
CMMatchOption options;
XYZColor white;
XYZColor black;
typedef struct CMProfileChromaticities {
XYZColor red;
XYZColor green;
XYZColor blue;
XYZColor cyan;
XYZColor magenta;
XYZColor yellow;
} CMProfileChromaticities;
typedef struct CMProfileResponse {
unsigned short counts[onePlusLastResponse];
CMResponseData data[1];
typedef struct CMProfile {
CMHeader header;
CMProfileChromaticities profile;
CMProfileResponse response;
IString profileName;
char customData[1];
} CMProfile, *CMProfilePtr, **CMProfileHandle;
CMMs are components of type 'cmm ' that contain code to perform matching. The
component subtype distinguishes between different CMMs. ColorSync ships with the
default Apple CMM, which has the subtype 'appl'. Developers who want to provide
custom CMMs to perform matching beyond the capabilities of Apple's basic color
matching method need to register their CMM subtype with the Apple Registry
(AppleLink REGISTRY) to avoid conflict with other CMM manufacturers. The only