xicc/xicclu 

Summary 

Lookup individual color values forward or inverted though an ICC profile table. xicclu is the analogue of the icclib utility icclu, but expands the capability to reverse lookup the Lut tables, and displaying PCS values in CIECAM02 Jab space. xicclu can also be used to plot the device value composition down the neutral axis, for device profiles.

Usage Summary

 xicclu [-options] profile
 -v                Verbose
 -g                Plot neutral axis device values.
 -f function   f = forward, b = backwards, g = gamut, p = preview
                    if = inverted forward, ib = inverted backwards
 -i intent        p = perceptual, r = relative colorimetric,
                    s = saturation, a = absolute, j = Appearance CIECAM02
                    k = Absolute Appearance CIECAM02
 -o order        n = normal (priority: lut > matrix > monochrome)
                     r = reverse (priority: monochrome > matrix > lut)
 -p oride         x = XYZ_PCS, l = Lab_PCS, y = Yxy, j = Jab
 -s scale         Scale device range 0.0 - scale rather than 0.0 - 1.0
 -k [zhxrlv]  Black generation: z = zero K,
                     h = 0.5 K (def), x = max K, r = ramp K
                     l = extra PCS input is portion of K locus
                     v = extra PCS input is K target value
 -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
 -l tlimit          set total ink limit, 0 - 400%
 -L klimit        set black ink limit, 0 - 100%
 -a                 show actual target values if clipped
 -b                 merge output processing into clut
 -S                 Use internal optimized separation for inverse 4d [NOT IMPLEMENTED]
 -c viewcond   set viewing conditions for CIECAM02,
               either an enumerated choice, or a parameter:
               0: Practical Reflection Print
               1: Print evaluation environment
               2: Monitor in typical work environment
               3: Monitor in darkened work environment
               4: Projector in dim environment
               5: Projector in dark environment
               6: Original scene - Outdoors
               7: Photo CD - original scene
               8: 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, Abs: D50)
         w:x:y             Adapted white point as x, y
         a:adaptation       Adaptation 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, Abs: D50)
         f:x:y               Flare color as x, y

    The colors to be translated should be fed into standard in,
    one input color per line, white space separated.
    A line starting with a # will be ignored.
    A line not starting with a number will terminate the program.

Flags and Parameters

The -v flag enables more verbose output.

The -g flag causes a plot of the device values along the neutral axis to be plotted, rather than allowing the interactive looking up of color values. This is useful in determining the existing black generation in a CMYK profile, or exploring the behavior of various black generation options using the -k parameters. The profile must be a device profile, and the PCS must be either Lab or Jab. The plot up the neutral axis is from L or J = 100 (white) to L or J = 0 (black). To examine a profiles B2A table black generation, use the flag -fb to select the B2A table, or to invert the A2B table, and be able to explore black generation behavior, use the -fif flag. The appropriate intent can be selected with the -i flag,  as can other flags appropriate to the function selected.  See example.

The -f flag selects which type of table or conversion is to be used. In addition to the usual four tables that can be accessed in a fully populated Lut based profile, two additional options are available in xicclu. One is to invert the forward table, and the other is to invert the backward table. For non Lut based profiles, -fif is equivalent to -fb, and -fib is equivalent to -ff. Note that the -fib combination may not be fully supported.

The -i flag selects the intent for a lut based profile. In addition to the usual 4 ICC based intents, two other options are available: CIECAM02 Jab appearance space, and a version of Jab with a fixed white reference, which emulates an absolute CIECAM02 Jab appearance space.

A profile is allowed to contain more than the minimum number of elements or table needed to describe a certain transform, and may contain redundant descriptions.  By default, Lut based table information will be used first if present, followed by matrix/shaper information, and only using monochrome information if it is all that is present. The -o flag, reverses this order.   

Normally the native PCS (Profile Connection Space) of a device or abstract profile is used, but the -p flag allows this to be overridden, and XYZ, L*a*b*, Yxy space or Jab (CIECAM02) space to be substituted.

Usually device values are processed and displayed using a normalized value range between 0.0 and 1.0 Sometimes other systems scale them to some other range (such as 100 or 255) due to an underlying binary representation. The -s flag lets you input and display such data in its normal range. For instance, if your device values have a range between 0 and 255, use -s 255.

When inverting a CMYK profile, (ie. using the -fif flag), an input PCS value can have many possible CMYK solutions. To be able to return a unique solution, a black level (or black inking rule) should be chosen. The choice here reflect similar choices in black generation available in other utilities (eg. profile, icclink), with the addition of two extra options.

 Possible arguments to the -k option are:

-kz selects minimum black (0.0)
-kh selects a black locus value of 0.5
-kx selects the maximum possible black (1.0)
-kr selects a linear locus ramp, starting at minimum black for highlight, and maximum black for shadow (equivalent to -kp 0 0 1 1 1)
-kl uses an extra (fourth) value entered after the input PCS value, to select a black locus target between 0.0 and 1.0.
-kv uses an extra (fourth) value entered after the input PCS value, to select a black ink target value between 0.0 and 1.0.
-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 locus generation curve with parameters something like: -kp .1 .3 .5 .8 1

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


 The -g flag can be used together with the -fif flag, to plot out the resulting black channel behavior for various -k parameter values.

-l tlimit     Sets the total ink limit (TAC, Total Area Coverage) for the CMYK inverse forward lookup, as a total percentage from 0% to 400%.

-L klimit    Sets the black ink limit for the CMYK inverse forward lookup, as a total percentage from 0% to 100%.

If the -a flag is used for inverse forward lookups, then if the target PCS value cannot be reproduced by the device (ie. it clips), then the achievable, clipped PCS value is displayed.

The -b flag turns on an internal processing option, in which the per device curve lookup table processing is merged into the main multi-dimensional interpolation lut lookup.

The -S flag is not currently implemented.

Whenever PCS values are to be specified or displayed in Jab/CIECAM02 colorspace, a set of viewing conditions will be used to determine the details of the conversion. The -c parameter allows the specification of the 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.

Usage and Discussion

Typical usage for an output profile might be:

    xicclu -ff -ip profile.icm

Normally the program is interactive, allowing the user to type in input color values, each number separated by a space, and the resulting output color being looked up and displayed after pressing return. To batch process a group of color values, prepare a text file containing each input value on a separate line, and use the input indirection facilities of your command line shell to redirect this input file into the standard input of xicclu. The output can be captured to a file by redirecting standard output to a file. In most shells this would be done something like this:

    xicclu -ff -ip profile.icm < inputvalues.txt > outputvalues.txt

When plotting the neutral axis behavior, plotting the existing B2A table behavior would typically be done something like this:

    xicclu -g -fb profile.icm

Exploring possible black generation and ink limiting behavior might be done like this:

    xicclu -g -fif -kp 0 .1 .8 .7 1 -l230 -L95 profile.icm