profile/colprof

Summary

Create an ICC profile from the .ti3 test chart patch values.

Usage Summary

 colprof [-options] outfile
 -v                 Verbose mode
 -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
 -q lmhu            Quality - Low, Medium (def), High, Ultra
 -b [lmhun]         Low quality B2A table - or specific B2A quality or none for input device
 -y                 Verify A2B profile
 -ni                Don't create input (Device) shaper curves
 -np                Don't create input (Device) grid position curves
 -no                Don't create output (PCS) shaper curves
 -nc                Don't put the input .ti3 data in the profile
 -k zhxr            Black generation: z = zero K,
                      h = 0.5 K (def), x = max K, r = ramp K
 -k p stle stpo enpo enle shape
                      stle: K level at White 0.0 - 1.0
                      stpo: start point of transition Wh 0.0 - Bk 1.0
                      enpo: End point of transition Wh 0.0 - Bk 1.0
                      enle: K level at Black 0.0 - 1.0
                      shape: 1.0 = straight, 0.0-1.0 concave, 1.0-2.0 convex
 -K parameters      Same as -k, but target is K locus rather than K value itself
 -l tlimit          override CMYK total ink limit, 0 - 400% (default from .ti3)
 -L klimit          override black ink limit, 0 - 100% (default from .ti3)
 -a lxgs            Algorithm type override
                      l = Lab clut (def.), x = XYZ lut
                      g = gamma+matrix, s = shaper+matrix
                      G = single gamma+matrix, S = single shaper+matrix
 -u                 If Lut input profile, make it absolute (non-standard)
 -i illum           Choose illuminant for print/transparency spectral data:
                      A, D50 (def.), D65, F5, F8, F10 or file.sp
 -o observ          Choose CIE Observer for spectral data:
                      1931_2
(def.), 1964_10, S&B 1955_2, shaw, J&V 1978_2
 -f                 Use Fluorescent Whitening Agent compensation
 -r avgdev          Average deviation of device+instrument readings as a percentage (default 0.5%)
 -s src.icc         Apply gamut mapping to perceptual B2A table for given source
 -S src.icc         Apply gamut mapping to perceptual and saturation B2A table
 -nP                Use colormetric source gamut to make perceptual table
 -nS                Use colormetric source gamut to make saturation table
 -g src.gam         Use source image gamut as well for gamut mapping
 -p aprof.icm       Incorporate abstract profile into output tables
 -t intent          Override gamut mapping intent for perceptual table:
 -T intent          Override gamut mapping intent for saturation table:
                  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]
                 ms - Saturation
                  s - Enhanced Saturation [ICC Saturation]
                 al - Absolute Colorimetric (Lab)

 -c viewcond        set input viewing conditions for CIECAM02 gamut mapping,
                      either an enumerated choice, or a parameter
 -d viewcond        set output viewing conditions for CIECAM02, gamut mapping
                      either an enumerated choice, or a parameter:value change
                      Also sets out of gamut clipping CAM space.
                      Enumerated Viewing Conditions:
                 pp - Practical Reflection Print
                 pe - Print evaluation environment
                 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 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)
                        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
 -P                  Create gamut gammap_p.wrl and gammap_s.wrl diagostics
 inoutfile            Base name for input.ti3/output.icc file

Options

-v  Turn on verbose mode. Gives progress information as the profile is created. Since colprof can take a long time to generate, this is often useful to monitor progress. If used in combination with the -y flag, the error of each test point to the resulting profile will be printed out.

The -A parameter allows setting of the device manufacturer description tag. The parameter should be a string that identifies the manufacturer of the device being profiled. 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. The parameter should be a string that identifies the particular model of device being profiled. 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 device and 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.

The -q parameter sets the level of effort and/or detail in the resulting profile. For table based profiles ("lut" profiles), it sets the main lookup table size,  and hence quality in the resulting profile. 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.

The -b flag overrides the -q parameter, and sets the lut resolution for the BtoA (inverse) to a low value. The creation of the B2A table is fairly time consuming, and if the profile is only going to be used by targen, or if it will only be used as an input space profile, or if it will only be linked as an output profile using Argyll's  collink utility using the -G option (inverse AtoB option), then a high quality BtoA table is not required, and some time and profile space can be saved. If the profile is to be used as an output space profile with another CMS, or is going to be linked using the simple (-s) or mapping mode (-g) options, then the -b flag should NOT be set. Optionaly, a specific B2A table quality can be set.

For input devices,  the presence of a B2A table is not mandatory, and it can be omitted entirely from the profile by using -bn.

The -y flag does a verification check on the AtoB profile. This is done by comparing what CIE colors the profile predicts for the test chart test patches, and comparing them to the actual values. A summary of the average and maximum Lab delta E's will be printed out if this flag is set. If the -v flag is also set, then information for each patch will also be printed.

Normally Lut base profiles are generated with three major elements:- per device channel (shaper) input curves, the multi-dimensional lut table, and per PCS channel (shaper) output curves. The  Using the -ni flag disables the creation of the per device channel curves, while using the -no flag disables the creation of the per PCS channel curves.
For LUT based profiles, the input curves that are written to the profile are composed of two components, a shape to best match the detailed shape of the device behavior, and a shape to distribute the input values evenly across the LUT input indexes. The -no flag disables the former, while the -np flag disables the latter.

-nc Normally the device and CIE/spectral sample data used to create a profile is stored in a text tag in the resulting ICC profile. To suppress this and make the resulting profile smaller, use the -nc flag.

-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.

 Possible arguments to the -k flag are:

-kz selects minimum black (0.0)
-kh selects a black value of 0.5
-kx selects the maximum possible black (1.0)
-kr selects a linear black ramp, starting at minimum black for highlight, and maximum black for shadow (equivalent to -kp 0 0 1 1 1). This is the default.

-k p stle stpo enpo enle shape  allows an arbitrary black value 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.
 
The xicclu utility 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 of 0, and the latter corresponding to a locus target 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%, and overrides any ink limit specified in the .ti3 file. 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.

The -L klimit parameter sets the black channel ink limit for the CMYK separation, as a total percentage from 0% to 100%. 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%. Note that with the current implementation this can slow down the creation of the profile quite noticeably, so do not use -L unless you really need to.

The -a parameter allows choosing an alternate profile type. By default (equivalent to -al) profile creates a lut based table profile with a PCS (Profile Connection Space) of L*a*b*, which generally gives the most accurate results, and allows for the four different rendering intents that ICC profiles can support. A lut base table profile using a PCS of XYZ can be created if -ax is used. For RGB input or display profiles, a simpler type of profile using either a gamma curves or a general shaper curves, combined with a matrix can be created, although such a profile cannot support perceptual or saturation intents. Gamma curve and matrix profiles can be created by specifying -ag or -aG, the former creating three independent gamma curves, one for each device channel, and the latter creating one common curve for all the device channels. The latter may be needed with certain applications that will not accept different gamma curves for each channel. General shaper curve and matrix profiles (which are superior to gamma curve profiles) can be created by specifying -as or -aS, the former creating three independent shaper curves, one for each device channel, and the latter creating one common curve for all the device channels. The latter may be needed with certain applications that will not accept different shaper curves for each channel.

Lut style input profiles will normally be created such that the white point of the test chart, will be mapped to perfect white when used with any of the non-absolute colorimetric intents. This is the expected behaviour for input profiles. If such a profile is then used with a sample that has a lighter color than the original test chart, the profile will clip the value, since it cannot be represented in the lut table. Using the -u flag causes the lut based input profile to be constructed so that the lut table contains absolute color values, and the white of the test chart will map to its absolute value, and any values whiter than that, will not be clipped by the profile. The profile effectively operates in an absolute intent mode,  irrespective of what intent is selected when it is used. This flag can be useful when an input profile is needed for using an acquisition device as a "poor mans" colorimeter, or if the white point of the test chart doesn't represent the white points of media that will be used in practice, and that white point adjustment will be done individually in some downstream application.

The -i flag allows specifying a standard or custom illumination spectrum, applied to spectral .ti3 data to compute PCS (Profile Connection Space) tristimulus values. A, D50, D65, F5, F8, F10 are a selection of standard illuminant spectrums, with D50 being the default. If a filename is specified instead, it will be assumed to be an Argyll specific .sp custom spectrum file. This only works if spectral data is available. Illuminant details are:

        A   CIE tungsten filament lamp 2848K
        D50 CIE daylight 5000K
        D65 CIE daylight 6500K
        F5  CIE Fluorescent 6350K, CRI 72
        F8  CIE Fluorescent 5000K, CRI 95
        F10 CIE Fluorescent 5000K, CRI 81

Custom illuminants are most often used when a fluorescent tube base viewing booth is going to be used to view results.  Other illuminant reference files could be created using a suitable measuring instrument such as a spectrocam, or an eyeone, although such instruments do not provide the necessary response down to Ultra Violet that is needed for accurate operation of Fluorescent Whitening Agent compensation.
Note that if an illuminant other than D50 is chosen, the resulting ICC profile will not be standard, and cannot be freely interchanged with other profiles that that us the standard D50 illuminant, particularly if the absolute rendering intent is used. Profiles should generally be linked with other profiles that have the same illuminant and observer.

The -o flag allows specifying a tristimulus observer, and is used to compute PCS (Profile Connection Space) tristimulus values. The following choices are available:
  1931_2 selects the standard CIE 1931 2 degree observer. The default.
  1964_10 selects the standard CIE 1964 10 degree observer.
  1955_2 selects the Stiles and Birch 1955 2 degree observer
  1978_2 selects the Judd and Voss 1978 2 degree observer
  shaw selects the Shaw and Fairchild 1997 2 degree observer

Note that if an observer other than 1931 2 degree is chosen, the resulting ICC profile will not be standard, and cannot be freely interchanged with other profiles that that us the standard 1931 2 degree observer. Profiles should only be linked with other profiles that have the same illuminant and observer. The 1978_2 observer or shaw observer may give slightly better results than the 1931_2 observer.

The -f flag enables Fluorescent Whitening Agent (FWA) compensation. This only works if spectral data is available, and allows the effects of different levels of Ultra Violet in the viewing illuminant from that used by the instrument, be compensated for. This will only work accurately if you specify the actual illuminant spectrum you are using to view the print, using the -i flag. If you are doing proofing, you need to apply this to both your source profile, and your destination profile. Note that it is not sufficient to specify an illuminant with the same white point as the one you are using, you should specify the spectrum of the illuminant you are actually using for the proofing, including its Ultra Violet spectral content, otherwise FWA compensation won't work properly (but see the note above about non-standard illuminants and observers). This means you ideally need to measure your illuminant spectrum using an instrument that can measure down to 300nm. Such instruments are not easy to come by. An alternative is to simply try different illuminant spectra in the directory, and see if one gives you the result you are after. The ref/D50_X.X.sp set of illuminant spectra are the D50 spectrum with different levels of U.V. added or subtracted, ref/D50_1.0.sp being the standard D50 illuminant, and may be somewhere to start. Note that using the ref/D50_0.0.sp spectrum with -f gives a result that is comparable to that of a U.V. cut filter. See also the discussion About Fluorescent Whitening Agent compensation.
 [Note: Generally using -f with the standard D50 illuminant spectrum will predict that the device will produce bluer output than the default of not FWA compensation. This is because most instruments use an incandescent illuminant, which has lower relative levels of U.V. than D50, so the FWA compensation simulates the effect of the greater U.V. in the D50. Also note that in an absolute colorimetric color transformation, the more a profile predicts the output device will have blue output, the yellower the result will be, as the overall color correction compensates for the blueness. The opposite will happen for an input profile.]

The -r parameter specifies the average deviation of device+instrument readings from the perfect, noiseless values as a percentage. Knowing the uncertainty in the reproduction and test patch reading can allow the profiling process to be optimized in determining the behaviour of the underlying system. The lower the uncertainty, the more each individual test reading can be relied on to infer the underlying systems color behaviour at that point in the device space. Conversely, the higher the uncertainty, the less the individual readings can be relied upon, and the more the collective response will have to be used. In effect, the higher the uncertainty, the more the input test patch values will be smoothed in determining the devices response. If the perfect, noiseless test patch values had a uniformly distributed error of +/- 1.0% added to them, then this would be an average deviation of 0.5%. If the perfect, noiseless test patch values had a normally distributed  error with a standard deviation of 1% added to them, then this would correspond to an average deviation of 0.564%. For a lower quality instrument (less than say a Gretag Spectrolino or Xrite DTP41), or a more variable device (such as a xerographic print engine, rather than a good quality inkjet), then you might be advised to increase the -r parameter above its default value (double or perhaps 4x would be good starting values.)

-s -S  In order to generate perceptual and saturation intent B2A tables, it is necessary to specify at least one profile to define what source gamut should be used in the source to destination gamut mapping. [For more information on why a source gamut is needed, see About ICC profiles and Gamut Mapping] The -S parameter is used to do this, and doing so causes perceptual and saturation tables to be generated. If only a perceptual intent is needed, then the -s flag can be used, and the saturation intent will use the same table as the perceptual intent. Note that a input, output, display or device colororspace profile should be specified, not a non-device colorspace, device link, abstract or named color profile.
If no source gamut is specified for a Lut Display profile, then an ICC Version 2.2.0 profile will be created with only an A2B0 and B2A0 tag. If a source gamut is specified, then an ICC Version 2.4.0 profile will be created with a full complement of B2A tags to support all intents. The source gamut is created from the corresponding intent table of the provided profile to the output table being created. A TIFF file containing an embedded ICC profile may be supplied as the argument.

-nP: Normally when a source profile is provided to define the source gamut for the perceptual table gamut mapping, the perceptual source table is used to determine this gamut. This is because some profile have gamut transformations in their perceptual A2B tables that is not in the colorimetric A2B table, and this needs to be taken into account in creating the perceptual B2A table, so that when the two profiles are linked together with the perceptual intent, the gamut mapping works as intended. The -nP option causes the source gamut to be taken from the source profile colorimetric table instead, causing the perceptual gamut mapping created for the perceptual table to be from the natural source colorspace gamut to the output space gamut.

-nS: Normally when a source profile is provided to define the source gamut for the saturation table gamut mapping, the saturation source table is used to determine this gamut. This is because some profile have gamut transformations in their saturation A2B tables that is not in the colorimetric A2B table, and this needs to be taken into account in creating the saturation B2A table, so that when the two profiles are linked together with the saturation intent, the gamut mapping works as intended. The -nS option causes the source gamut to be taken from the source profile colorimetric table instead, causing the saturation gamut mapping created for the saturation table to be from the natural source colorspace gamut to the output space gamut.

The -g flag and its argument allow the use of 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 utility. The gamut provided to the -g flag should be in the same colorspace that colprof 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 input profile viewing conditions. The input profile will normally be the one used to create a source image gamut using tiffgamut.

The -p option alows specifying an abstract profile be applied to all of the output tables, after any gamut mapping. 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.

One strategy for getting the best perceptual results when using ICC profiles with systems that don't accept device link profiles, is as follows: Specify a gamut mapping profile of opposite type to the type of device being profiled, and when linking, use the relative colorimetric intent if the two profiles are of the same type, and perceptual intent if the two profiles are of the opposite type. For instance, if you are creating a CMYK output profile, specify an RGB profile for the -s or -S parameter. If linking that profile with a CMYK source profile, use relative colorimetric intent, or if linking with an RGB profile, use the perceptual intent. Conversely, if creating an RGB output profile, specify a CMYK profile for the -s or -S parameter, and if linking that profile with an RGB source profile, use relative colorimetric intent, or if linking with a CMYK profile, use the perceptual intent.

Normally, the gamut mapping used in creating the perceptual and saturation intent tables is set to perceptual and saturation gamut mapping (as would be expected), but it is possible to override this default selection for each intent using the -t and -T flags. The -t flag can be used to set the gamut mapping for the perceptual table, and the -T flag can be used to set the gamut mapping for the saturation table. A more detailed description of the different intents is given in collink. Note that selecting any of the absolute intents will probably not function as expected, since the perceptual and saturation tables are inherently relative colorimetric in nature.

Since appearance space is used in the gamut mapping (just as it is in collink), the viewing conditions for the source and destination colorspaces should really be specified. The source colorspace is the profile specified with the -s or -S flag, and the destination is the profile being created. The -c and -d options allow specification of their respective, associated viewing conditions. 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 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.

Appearance space is also used to provide a space to map any remaining out of gamut colors (after a possible gamut mapping has been applied) into the device gamut.

The -P option causes diagnostic 3D VRML plots to be created that illustrate the gamut mappings generated for the perceptual and saturation intent tables.

The final parameter is the file base name for the .ti3 input test point data, and the resulting ICC output profile (.icm extension on the MSWindows platform, .icc on Apple or Unix platforms).

Discussion

Note that monochrome profiling isn't currently supported. It may be supported sometime in the future.

If the -v flag is used (verbose), then at the end of creating a profile, the maximum and average fit error of the input points to the resulting profile will be reported. This is a good guide as to whether things have gone smoothly in creating a profile. Depending on the type of device, and the consistency of the readings, average errors of 5 or less, and maximum errors of 15 or less would normally be expected. If errors are grossly higher than this, then this is an indication that something is seriously wrong with the device testing, or profile creation.

Given a .ti3 file from a display device that contains display RAMDAC calibration information (generated by dispcal, passed through dispread),  colprof will convert this into a vcgt tag in the resulting profile, so that the operating system utilities can configure the display hardware appropriately, whenever the profile is used.