Appendix G. Color Management in Impressario

Impressario uses International Color Consortium (ICC) color profiles and PostScript Color Rendering Dictionaries (CRDs) for color management.

This appendix discusses the following topics:

An Overview

Color management is the process of specifying the color characteristics of peripheral devices and applying this information to allow color to be used more consistently throughout the system. Different devices have different color characteristics. The characteristics can be physical differences such as paper and ink for printers and phosphors for monitors. They also can be color space differences. A color space is a conceptual model for representing color.

Scanners and monitors usually use the RGB color space. Red, green, and blue are the primary colors in this space; all colors are mixtures of these. RGB is an additive color space. Red, green, and blue light are added to form a desired color. When full intensities of red, green, and blue light are used, the result is white light.

Printers use the CMY or CMYK color space. Cyan, magenta, and yellow are the primary colors. It is a subtractive color space: the color is that of the light that is reflected after parts of the white-light spectrum are absorbed by the medium, such as ink on paper. Theoretically, a mixture of cyan, magenta, and yellow subtractive colorings results in black because all of the white light is absorbed. In reality, a black color, denoted by K, is usually used because the CMY ink-on-paper mixture does not absorb light perfectly.

The technique of color management is to use color spaces to characterize input and output devices, and to provide the conversions needed to maintain consistent color use among them. Conversions may go directly from one color space to another, such as from RGB for a scanner to CMYK for a printer. Alternatively, conversions may make use of intermediary color spaces, such as CIE-based ones. (CIE stands for the Commission Internationale d'Eclairage.) The CIE color spaces are intended as representations of color as seen by the human eye. They are considered device-independent, in contrast to the RGB and CMYK spaces, whose color representations vary with the physical characteristics of the devices producing them. A common CIE-based space is CIELAB, which is based on the three types of stimuli to which the eye's retina responds. For a further discussion of color conversion, consult a text such as Computer Graphics: Principles and Practice, Second Edition, by Foley, van Dam, Feiner, and Hughes.

Impressario provides two tools for color management:

  • ICC color profiles for SGI, TIFF, GIF, JPEG, PCD, and PPM raster image files

  • PostScript CRDs for PostScript files that specify CIELAB-based color spaces

ICC Color Profiles

International Color Consortium(ICC) color profiles describe the color characteristics of source devices, such as scanners, and destination devices, such as printers. (A monitor is considered to be another type of device because it can be both a source and a destination.) Profiles are available for various scanners, printers, and monitors. By using the information from the source and destination profiles, a color correction can be determined and applied to the image.

The scanning program gscan adds the ICC source profile to its output (a TIFF or Silicon Graphics image raster file). Embedding the source profile in the output allows the file to be moved to systems that don't have that profile. With gscan, the user can choose from several scanner profiles, or even turn off color management altogether. The Impressario User's Guide has further information on scanning and gscan.

During printing, color correction is applied to a raster image by the cocostiff or cocogif utility before the image is processed by the PostScript interpreter. (cocostiff (Color Correct Stream Tiff) and cocogif (Color Correct GIF) are part of the cms_eoe subsystem) The Impressario file convert rules automatically invoke cocostiff or cocogif.

Use fileconvert to see how the file convert rules are applied:

/usr/sbin/fileconvert -d ImpressarioRasterBitmap /usr/impressario/tests/data/testfile.sgi

returns

PRINTFILES=”/usr/impressario/tests/data/testfile.sgi” ; /usr/lib/print/sgi2stiff $IMPR_IMG2STIFFOPTS $PRINTFILES | /usr/sbin/cocostiff $IMPR_CMGTOPTS  | /usr/lib/print/stiff2ps $IMPR_SGI2PSOPTS | /usr/lib/print/psrip $IMPR_PSRIPOPTS

In this example, sgi2stiff converts the SGI format to the STIFF format, the output being piped to cocostiff. The command-line options of cocostiff, -d hp650e06.pf for example, are contained in the environment variable $IMPR_CMGTOPTS. This value, like those of the other uppercase environment variables, is normally set in a printer model file. (See the cocostiff(1) reference page for details about specific command-line options.) cocostiff applies the color correction, and its output is piped to stiff2ps and then to psrip, the PostScript interpreter.

It is important to note that an ICC profile describing the source device is needed to do color correction. As mentioned above, gscan embeds a source profile in the files it creates. Of course, not all files are created by gscan. If a source profile is not embedded in the raster file, cocostiff and cocogif use the ICC color profile of a Sony monitor. The idea is for the default printed output to look similar to what would be displayed on the screen. Naturally, a source profile for a Sony monitor is needed to do this. cocostiff and cocogif also accept, as a command-line argument, a source profile that overrides the default profile and, if so specified, any embedded source profiles. See the cocostiff(1) and cocogif(1) reference pages for details.

ICC color profiles are stored in the /var/cms/profiles directory. cocostiff and cocogif search this directory for any profile specified as a command-line argument and whose profile name does not include a full directory path.

For further information on ICC color profiles, see the web page at http://www.color.org. Search the web using the search string “International Color Consortium” to find several other technical references and applications.

Color Rendering Dictionaries

Color Rendering Dictionaries are used to manage the color of PostScript files, such as ones produced by Adobe Photoshop, that specify CIELAB-based color spaces. PostScript files, such as those generated by ShowCase, that do not specify a CIELAB-based color space do not have color management.

CRDs are stored in /usr/lib/print/data/CRDs. A specific CRD is typically specified using the -I option with psrip. CRDs can be modified for use with the -I option by adding text at the end of the CRD to define it as a resource. An example of this is the last few lines from the /usr/lib/print/data/CRDs/hp1600C.crd file:

/1600CCRD exch /ColorRendering defineresource pop
%%EndResource
{/1600CCRD /ColorRendering findresource } stopped
{ (%%[ Warning: Color CRD not found ]%%\r\n) print flush }
{dup /DefaultColorRendering exch /ColorRendering defineresource pop
setcolorrendering } ifelse


Tip: CRDs are usually binary files. If your editor can not edit the file, try using jot.

If a CRD is not specified with -I, a default is used. Default CRDs are in the directory /usr/lib/print/data/psrip/Resource/ColorRendering. ColorCRD is the default color CRD and MonoCRD is the default for monochrome images.

Generating CRDs and ICC Profiles

When creating CRDs and ICC profiles, remember that many variables affect the color that is produced. These include the following:

  • halftone screen or dithering (such as spot function or error diffusion)

  • resolution (for example, 360 dpi or 720 dpi)

  • paper type (plain, coated, transparencies, and so on)

  • ink lot (changing inks can change output color)

  • printer manufacturing variations

  • age of the printers

  • settings (draft, normal, presentation, microdot, and so on, depending on the printer)

Handling every case would require a separate CRD and ICC profile for each of the various combinations. In practice, this is rarely done because it requires a large number of CRDs and ICC profiles. A common approach, used by Impressario 2.0, is to generate one or two CRDs and profiles using the highest resolution, best paper, and best settings for the printer in question. The idea is to generate the CRDs and profiles for the printer when it is set to print in its best presentation mode.

Generating an ICC profile or a CRD typically consists of these steps:

  1. Generate a test pattern containing a large number of color samples (say, 300 to 500).

  2. Measure the color samples using a Colorimeter.

  3. Generate several profiles and CRDs (for shadows, for highlights, and so on.)

  4. Print sample images using the various CRDs and profiles, and select a preferred set.

  5. Update the model file to use the preferred set.

This process requires specific software tools (and a lot of time). Impressario 2.0 does not include these tools, but third-party solutions are available. (If you use a third-party service or software package to generate ICC profiles or CRDs you should verify that you have the right to re-distribute them.)


Note: ColorSynergy® software by Candela generated all the CRDs and many of the ICC profiles for Impressario 2.n. A ColorTron colorimeter from Light Source was the input measuring device. For more information about these products contact:


Candela, Ltd.

Light Source Computer Images, Inc.

1676 East Cliff Road

17 E. Sir Francis Drake Suite 100

Burnsville, MN 55337-1300

Larkspur, CA 94939

612 894-8890

415 925-4200

612 894-8840 (fax)

415 461-8011 (fax)

 

URL: http://www.ls.com

As a final step, look at the way ICC profiles and CRDs are used in the model file /var/spool/lp/model/deskjetII_model. At the beginning of this file, default ICC profiles and CRDs are set for every printer. When the script is run, it calls the function get_icc_crd_name() to determine names for the ICC profile and CRD based on the printer model, paper type, and halftone being used. For example, if the printer is an HP DeskJet 1600C, get_icc_crd_name() returns two of the following names (one for an ICC profile, the other for a CRD):

ICC Profile Name

 

CRD Name

HP_DeskJet_1600C_special_spot.pf

HP_DeskJet_1600C_special_spot.crd

HP_DeskJet_1600C_special_diffused.pf

HP_DeskJet_1600C_special_diffused.crd

HP_DeskJet_1600C_glossy_spot.pf

HP_DeskJet_1600C_glossy_spot.crd

HP_DeskJet_1600C_glossy_diffused.pf

HP_DeskJet_1600C_glossy_diffused.crd

It is the command returned by fileconvert, later in the model file, that determines whether the ICC profile or CRD is used. If the file to be printed is a raster image, color correction is performed using an ICC profile. If the HP 1600C is using glossy paper and error diffusion, and if an ICC profile in the /var/cms/profiles directory has the name HP_DeskJet_1600C_glossy_diffused.pf, the model file will find and use it. Otherwise it uses a default. After color correction, the file to be printed is converted to a PostScript file that is not CIELAB-based, and the PostScript file is sent to the PostScript interpreter.

If the file to be printed is already PostScript, it is sent directly to the PostScript interpreter where a CRD is then applied if the file is CIELAB-based. As before, a default CRD is used if one with the proper name is not found. Notice that a CRD is never used on a PostScript file that has undergone color correction with an ICC profile.

If you implement a function similar to get_icc_crd_name(), you should document the ICC profiles and CRD names that the driver recognizes. This allows users who create their own ICC profiles and CRDs to install them in the correct directories using the correct names. The goal is to enable users to supply ICC profiles and CRDs specific to the printers, inks, paper stocks, and so on in their environment.