link/collink

Summary

Link two ICC device profiles to create an ICC device link profile.

collink takes two device ICC profiles, and links them together, either in a simple fashion using the standard ICC forward and reverse tables of the specified intent, or using color appearance space and true gamut mapping, together with possibly inverting the forward profile,  to allow black ink regeneration or to retain the source black characteristic from the source profile.

Usage Summary

collink [-options] srcprofile dstprofile linkedprofile
 -v                 Verbose
 -A "manufacturer"  Set the manufacturer description string
 -M "model"         Set the model description string
 -D "description"   Set the profile Description string  (Default "inoutfile")
 -C "copyright"     Set the copyright string

 -V                 Verify existing profile, rather than link (Debug option)
 -q lmhu            Quality - Low, Medium (def), High, Ultra
 -r res             Override clut res. set by -q
 -n                 Don't preserve device curves in result
 -f                 Special :- Force neutral colors to be K only output.
 -fk                Special :- Force K only neutral colors to be K only output
 -fcmy              Special :- Force 100% C,M or Y only to stay pure
 -F                 Special :- Force all colors to be K only output.
 -p aprof.icm       Include abstract profile in link
 -s                 Simple Mode (default)
 -g [src.gam]       Gamut Mapping Mode [optional source image gamut]
 -G [src.gam]       Gamut Mapping Mode using inverse outprofile A2B [optional source gamut]

     Simple Mode Options:
 -i in_intent      p = perceptual, r = relative colorimetric,
                   s = saturation, a = absolute colorimetric
 -o out_intent     p = perceptual, r = relative colorimetric,
                   s = saturation, a = absolute colorimetric

     Mapping Mode Options:
 -i intent      set linking intent from the following choice:
              a - Absolute Colorimetric (in Jab) [ICC Absolute Colorimetric]
             aw - Absolute Colorimetric (in Jab) with scaling to fit white point
             aa - Absolute Appearance
              r - White Point Matched Appearance [ICC Relative Colorimetric]
             la - Luminance matched Appearance
              p - Perceptual (Preferred) [ICC Perceptual]
             pa - Perceptual Appearance
             ms - Saturation
              s - Enhanced Saturation [ICC Saturation]
             al - Absolute Colorimetric (Lab)
 -w [J,a,b]     Use forced whitepoint hack [optional color to map the white to]
 -c viewcond    set source viewing conditions for CIECAM02,
                  either an enumerated choice, or a parameter
 -d viewcond    set destination viewing conditions for CIECAM02,
                  either an enumerated choice, or a parameter:value change
              pp - Practical Reflection Print (ISO-3664 P2)
              pe - Print evaluation environment (CIE 116-1995)
              pc - Critical print evaluation environment (ISO-3664 P1)
              mt - Monitor in typical work environment
              mb - Monitor in bright work environment
              md - Monitor in darkened work environment
              jm - Projector in dim environment
              jd - Projector in dark environment
             pcd - Photo CD - original scene outdoors
              ob - Original scene - Bright Outdoors
              cx - Cut Sheet Transparencies on a viewing box
          s:surround n = auto, a = average, m = dim, d = dark,
                     c = transparency (default average)
          w:X:Y:Z       Adapted white point as XYZ (default media white)
          w:x:y         Adapted white point as x, y
          a:adaptation  Adaptatation luminance in cd.m^2 (default 50.0)
          b:background  Background % of image luminance (default 20)
          l:scenewhite  Scene white in cd.m^2 if surround = auto (default 250)
          f:flare       Flare light % of image luminance (default 1)
          f:X:Y:Z       Flare color as XYZ (default media white)
          f:x:y         Flare color as x, y
 -t tlimit          set source total ink limit, 0 - 400% (estimate by default)
 -T klimit          set source total ink limit, 0 - 100% (estimate by default)

       Inverse outprofile A2B Options:
 -k tezhxr        CMYK Black generation
                  t = transfer K from source to destination, e = retain K of destination B2A table
                  z = zero K, h = 0.5 K, x = maximum K, r = ramp K (default)
 -k p stle stpo enpo enle shape
                  p = black level generation curve parameters
 -k q stle0 stpo0 enpo0 enle0 shape0 stle2 stpo2 enpo2 enle2 shape2
                  q = transfer source K to dual curve limits
 -K parameters      Same as -k, but target is K locus rather than K value itself
 -l tlimit          set destination total ink limit, 0 - 400% (estimate by default)
 -L klimit          set destination total ink limit, 0 - 100% (estimate by default)
  -P                 Create gamut gammap_p.wrl and gammap_s.wrl diagostics

 srcprofile         source ICC profile. A TIFF or JPEG file with embedded profile may be used here.
  dstprofile         destination ICC profile. A TIFF or JPEG file with embedded profile may be used here.
 linkedprofile      resulting device link profile

Usage Details and Discussion

-v Turns on verbose mode. Gives progress information as the profile is created. Since gamut map mode inverse profile linking can take a long time to perform, this is often useful.

The -A parameter allows setting of the device manufacturer description tag. This parameter may not be relevant for a link profile, but if used should be a string that identifies the manufacturer of the primary device used in the link. With most command line shells, it will be necessary to enclose the parameter with double quotes, so that spaces and other special characters are included in the parameter, and not mistaken for the start of another flag, or as a final command line parameters. By default no manufacturer description string tag will be generated for the profile.

The -M parameter allows setting of the device mode description tag. This parameter may not be relevant for a link profile, but if used should be a string that identifies the particular model of primary device used in the link. With most command line shells, it will be necessary to enclose the parameter with double quotes, so that spaces and other special characters are included in the parameter, and not mistaken for the start of another flag, or as a final command line parameters. By default no model description string tag will be generated for the profile.

The -D parameter allows setting of the profile description tag. The parameter should be a string that describes the profile. On many systems, it will be this string that will be used to identify the profile from a list of possible profiles. With most command line shells, it will be necessary to enclose the parameter with double quotes, so that spaces and other special characters are included in the parameter, and not mistaken for the start of another flag, or as a final command line parameter. Many programs that deal with ICC profiles use the description tag to identify a profile, rather than the profile filename, so using a descriptive string is important in being able to find a profile. By default, the base name of the resulting profile will be used as the description.

The -C parameter allows setting of the profile copyright tag. The parameter should be a string that describes the copyright (if any) claimed on the profile being generated.. With most command line shells, it will be necessary to enclose the parameter with double quotes, so that spaces and other special characters are included in the parameter, and not mistaken for the start of another flag, or as a final command line parameters. By default a generic copyright string will be generated for the profile.


-V Verifies an existing profile. This is really a debugging option. It is only useful if all the linking parameters are identical to those used during the creation of the profile being verified.

-q [lmhu]       Quality - Low, Medium (def), High, Ultra
-r res             Override clut res. set by -q

This sets the basic quality of the resulting link, by choosing the resolution of various tables in the resulting profile, as well as the resolution of other temporary tables used in creating the link. The -r flag allows overriding the resolution set by the -q option, for the ICC profile CLUT multi-dimensional interpolation table. It is highly recommended that -qm be used as a starting point, and other settings only tried after this has been evaluated. -qu should almost never be used, except to prove that it should almost never be used.

Normally the per channel device curves in the source and destination profiles are preserved in the resulting device link profile, but the -n option disables this. This can be useful if the device linearisation curves are inappropriate in nature.

The -f option is a special purpose flag useful only for 3 or 4 component (RGB, CMY or CMYK) source to CMYK destination linking, that causes the destination to be K only for neutral axis input. Neutral axis input is assumed for R=G=B or C=M=Y input values. So as to get a smooth mapping from the source to the K only destination, by default the gamut mapping will be adjusted to target the destination K only black, and Perceptual gamut mapping will be selected along with maximum K inking. If other options are selected that conflict with achieving a smooth mapping, warnings messages will be emitted.

The -F option is a special purpose flag useful only mapping to a CMYK destination, that causes the destination to be converted to K only monochrome. So as to get a smooth mapping from the source to the K only destination, by default the gamut mapping will be adjusted to target the destination K only black, and Perceptual gamut mapping will be selected along with maximum K inking. If other options are selected that conflict with achieving a smooth mapping, warnings messages will be emitted.

 The -fk option is a special purpose flag useful only for CMYK source to CMYK destination linking, that causes K only source values to map to K only destination values. This is often useful in re-targeting CMYK material while preserving K only text and graphics. So as to get a smooth mapping from the source to the K only destination, by default the gamut mapping will be adjusted to assume K only black source to destination K only black for K only values, and Perceptual gamut mapping will be selected along with a black generation rule (-kt) that preserves the black level from source to destination. If other options are selected that conflict with achieving a smooth mapping, warnings messages will be emitted.

 The -fcmy options are special purpose flags useful only for CMY or CMYK source to CMY or CMYK destination linking. The cmy flags may be used independently or in combination (ie. -fc, -fm, -fy, -fcm, -fcy, -fmy, -fcmy) or combined with the -fk option.  These flags ensure that the pure 100% primary colorant source values map to 100% pure colorant destination values, and may be useful in some situations where CMYK material is being re-targeted. Note that forcing the 100% colorant values to map this way largely works against the aims of color management in preserving colors appearance.  So as to get a smooth mapping from the source to  destination, by default the gamut mapping will a Saturation intent with 100 percept alignment of the selected C, M and/or Y cusp values. A Saturation intent is often what is desired in such CMYK to CMYK re-renderings, as it makes best use of the (usually quite similar sized) destination gamut. If other options are selected that conflict with achieving a smooth mapping, warnings messages will be emitted.

The -p option alows specifying an abstract profile be applied between the source and destination profiles. An abstract profile is a way of specifying a color adjustment in a device independent way. The abstract profile might have been created using one of the tweak tools, such as refine.

The basic linking style is chosen by using the -s (default), -g or -G flags. The three behaviors are:

 -s   Simple mode. No gamut mapping is performed, the selected intent AtoB and BtoA tables are simply concatenated to create the output link, with the gamut mapping behavior being determined solely by the BtoA table. The -i and -o options allow selection of the source and destination ICC intents. This is typically how other CMS do ICC linking. Details.

 -g   Gamut mapping mode. In this mode, the absolute colorimetric AtoB and BtoA tables are used to perform the link, and the intermediate linking color space is (generally) the CIECAM02 Jab appearance space. The source and destination viewing conditions can be selected using the -c and -d options. A gamut mapping is performed between the two spaces, using  the intent selected by the -i option. There is an optional argument, which is a source gamut to use instead of that of the source profile. This is to allow optimizing the gamut mapping to a source gamut of  a particular image, which can give slightly better results that gamut mapping from the gamut of the source colorspace. Such a source image gamut can be created using the tiffgamut tool. More  details about gamut mapping mode.

 -G  Use the gamut mapped, inverse AtoB table linking method. This is generally the most accurate, smooth and flexible linking method, but takes the longest to perform. The gamut mapping mode  (-g) options -i, -c, -d, -k and -l are effective when this method is selected. There is an optional argument, which is a source gamut to use instead of that of the source profile. This is to allow optimizing the gamut mapping to a source gamut of  a particular image, which can give slightly better results that gamut mapping from the gamut of the source colorspace. Such a source image gamut can be created using the tiffgamut tool. More details about the gamut mapping, inverse AtoB mode.

The gamut provided to the -g or -G flag should be in the same colorspace that collink is using internally to connect the two profiles. For all intents except the last one (no. 7), the space should be Jab appearance space, with the viewing conditions generally being those of the source profile viewing conditions. The source profile will normally be the one used to create a source image gamut using tiffgamut.
 
Simple mode gamut mapping options:

      -i in_intent       p = perceptual, r = relative colorimetric,
                            s = saturation, a = absolute colorimetric
      -o out_intent    p = perceptual, r = relative colorimetric,
                            s = saturation, a = absolute colorimetric

These two options simply select the appropriate ICC table, according to desired intent. Generally, it is a good idea to use the same intent for both source and destination. Not all ICC profiles support all four intents.

Gamut mapping mode options:

 -i intent

Select the gamut mapping intent. In gamut mapping mode there is only a single overall intent. The intent is selected using the 1 two letter option parameter, the standard ICC profile being a subset of the available selections.

The a intent, Absolute Colorimetric, is intended to reproduce colors exactly, irrespective of the white point of the each medium. This is done using CIECAM02 Jab appearance colorspace by forcing the source and destination to have a common white point (but other aspects of the individual viewing conditions are active), and colors are mapped directly from source to destination, clipping any out of gamut colors to the closest match. This is equivalent to the ICC Absolute Colorimetric intent, and is often used for proofing purposes.

The aw intent, Absolute Colorimetric with scaling to fit white point, is very similar to the a intent, except that it will scale the source colorspace down in order to make sure that the source white point isn't clipped by the gamut of the destination. This might be used in some print proofing situations where the source white is lightly lighter than the destination white (as an alternative to using the -w flag), or it may be useful in some soft proofing situations where the differences in white point of the display destination would cause clipping of the source white point.  When the -v flag is on, the scaling factor used will be displayed during execution.

The aa intent, Absolute Appearance, simply maps the Jab colors directly from source to destination, clipping any out of gamut colors to the closest match. This attempts to match the exact appearance of colors as closely as possible, but may not exactly map the white point of the source to the destination, depending on how different the viewing conditions are.

The r intent is like Absolute Appearance mode, but maps the white point from source to destination precisely, and otherwise maps the Jab colors directly from source to destination, clipping any out of gamut colors to the closest match. This is equivalent to the ICC Relative Colorimetric intent.

The la intent, Luminance matched appearance, linearly compresses or expands the the luminance axis to match the source to the destination space, while not otherwise altering the gamut, clipping any out of gamut colors to the closest match. This is often useful for appearance based soft proofing.

The  p intent, Perceptual, uses "knee" type 3 Dimensional compression to make the source gamut fit within the destination gamut. As much as possible, clipping is avoided, hues and the overall appearance is maintained. The white point is mapped precisely from source to destination.This is equivalent to the ICC Perceptual intent.

The  pa intent, Perceptual Appearance uses "knee" type 3 Dimensional compression to make the source gamut fit within the destination gamut. As much as possible, clipping is avoided, hues and the overall appearance is maintained. The white point is not mapped from source to destination, allowing the apperance parameters to alter the chromatic mapping.

The ms intent, Saturation, uses 3 Dimensional compression and expansion to try and make the source gamut exactly match the destination gamut, and also favours higher saturation over hue or lightness preservation. The white point is mapped precisely from source to destination.

The s intent, Enhanced Saturation, uses the same basic gamut mapping as ms, Saturation, but increases saturation slightly in highly saturated areas of the gamut. This is equivalent to the ICC Saturation intent. The white point is mapped precisely from source to destination.

The al intent, Absolute Appearance (Lab), is similar to intent a, but L*a*b* colorspace is used rather than CIECAM02 Jab appearance space. This often leads to poor reproduction of blue and red hues, but can be useful as a reference mapping.

The -w flag forces the white points to be mapped from source to destination, irrespective of the intent chosen. This is useful if absolute intent is being used, and the two media white points should match, but don't quite due to measurement error.
The -w flag can optionally be followed by three numbers, that specify a color that white should be mapped to. This will be in the colorspace used during linking (typically Jab space, which has similar characteristics to L*a*b* space). This options can be useful in fine tuning paper emulation in absolute colorimetric mapping mode.

The -c and -d options allow specification of the viewing conditions for the source and destination colorspaces respectively. The viewing condition information is used to map the profile PCS (Profile Connection Space, which us either XYZ or L*a*b*) color into appearance space (CIECAM02), which is a better colorspace to do gamut mapping in. The viewing conditions allow the conversion into appearance space to take account of how color will be seen under particular viewing conditions.
Viewing conditions can be specified in two basic ways. One is to select from the list of "pre canned", enumerated viewing conditions, choosing one that is closest to the conditions that are appropriate for the media type and situation. Alternatively, the viewing conditions parameters can be specified in detail individually. If both methods are used, them the chosen enumerated condition will be used as a base, and its parameters will then be individually overridden.

The -t tlimit parameter sets the total ink limit (TAC, Total Area Coverage) for a CMYK source profile, as a total percentage from 0% to 400%. This affects the gamut assumed for the source profile. By default, a total ink limit will be estimated from the source profile B2A table.

The -T klimit parameter sets the black channel ink limit for a CMYK source profile, as a total percentage from 0% to 100%. This affects the gamut assumed for the source profile. By default, a black ink limit will be estimated from the source profile B2A table.


Inverse outprofile A2B Options:

When the -G flag is used, the A2B table is inverted "on the fly", allowing various additional choices as to what device values are used to reproduce a particular color. (If the -G flag is not used, then such decisions are encoded in the B2A table in the profile, and cannot be altered during linking).

-k parameter sets the target level of black (K) when creating a B2A CMYK output tables. This is often called a black level, a black inking rule, black generation, or under color removal.  These set the target black level:

-kz selects minimum black (0.0)
-kh selects a black level value of 0.5
-kx selects the maximum possible black (1.0)
-kr selects a linear level ramp, starting at minimum black for highlight, and maximum black for shadow (equivalent to -kp 0 0 1 1 1). This is the default.
-kt, will preserve the black amount from the source (CMYK) profile to the destination  (CMYK) profile as much as possible. This may be most useful in creating a CMYK to CMYK conversion between two different press conditions, while preserving as much as possible the  black only use for text etc. in anything converted. Note that if the source black point is darker than the destination, composite black will still be generated for K only input. The -fk option can be used to avoid this behavior.
-ke, will preserve the black amount from the destination profile B2A table (CMYK).

-k p stle stpo enpo enle shape  allows an arbitrary black locus ramp to be defined, consisting of a starting value (stle) for highlights, a breakpoint L value (stpo) where it starts to transition to the shadow level, an end breakpoint L (enpo) where it flattens out again, and the finishing black level (enle) for the shadows. There is also a curve parameter, that modifies the transition from stle to enle to either be concave (ie.  the transition starts gradually and and finished more abruptly) using values 0.0-1.0, with 0.0 being most concave, or convex (the transition starts more abruptly but finishes gradually), using values 1.0-2.0, with 2.0 being the most convex.

Typical black value generation curve with parameters something like: -kp 0 .1 .9 1 .5

         1.0 K   |          enpo
                 |            _______  enle
                 |           /
                 |          /
                 |         /
                 |        /
           stle  | ------/
                 +-------------------
         0.0 K  0.0    stpo        1.0
               White              Black

For minimum sensitivity of printed output to the lighting spectrum, it currently seems best to use the maximum possible black, but other black generation levels (ie. 0.3 to 0.5) may well be preferred if one wants to minimize the noisy appearance of black on an inkjet device, or if the banding behaviour or other rendering flaws of the printer is to be minimized.

Note that the black level curve is applied throughout the gamut, resulting in GCR (Grey Component Replacement). There is no facility to restrict black to just neutral colors, hence UCR is not currently supported.

-k q stle0 stpo0 enpo0 enle0 shape0 stle2 stpo2 enpo2 enle2 shape2 is a combination of the -kt and -kp functionality, with the black being preserved in CMYK to CMYK linking, with the output black constrained to be between the first and second set of curve parameters.

The xicclu tool can be used to plot out the resulting black level for a given set of parameters, by using the -g flag of a profile already created from the same .ti3 file.

-K parameters. Any of the -k options above can use the -K version, in which rather than a black value target being defined by the inking rule, a black locus target is defined. For each lookup, the minimum possible black level and the maximum possible black level is determined, the former corresponding to a locus target value of 0, and the latter corresponding to a locus target value of 1. For instance, at the white point, no black will be used in the output, even if the black locus specifies a maximum (since the maximum amount of black that can be used to print white is actually zero). Similarly, at the black point, black may well be used, even if the black locus specifies zero black (since a certain amount of black is needed to achieve the desired density of color).

The -l tlimit parameter sets the total ink limit (TAC, Total Area Coverage) for the CMYK separation, as a total percentage from 0% to 400%. This affects the gamut assumed for the destination profile, as well as the ink limit in the generated device link. The limit value should generally be set a little below the value used in the test chart generation, to avoid the very edges of the gamut. If the test chart ink limit has been chosen to be a little beyond an acceptable level, then this number should be the acceptable level. Although limits can be set below 200%, this will generally restrict the color gamut noticeably, as fully saturated secondary colors will not be reproduced. Values are between 220% and 300% for typical printing devices. By default, a total ink limit will be estimated from the destination profile B2A table. The ink limit will be in final calibrated device values if the profile includes calibration information.

The -L klimit parameter sets the black channel ink limit for the CMYK separation, as a total percentage from 0% to 100%. This affects the gamut assumed for the source profile, as well as the ink limit in the generated device link. For printing press like devices, this can be used to prevent the black channel screening pattern "filling in". Typical values might be from 95% to 99%. By default, a black ink limit will be estimated from the source profile B2A table. The ink limit will be in final calibrated device values if the profile includes calibration information.

The -P option causes a diagnostic 3D VRML plots to be created that illustrate the gamut mapping generated.

The inprofile argument specifies the source profile. This is the color space/device we are attempting to emulate in the overall conversion. A TIFF or JPEG file with embedded profile may be used here.

The outprofile argument specifies the destination profile. This is the device we are actually displaying on or printing to. A TIFF or JPEG file with embedded profile may be used here.

The linkedprofile argument specifies the resulting device link profile. This profile will contain the color transform from the source space to destination space.

For information on typical usage, see the Typical Usage Scenarios page.