ccxxmake
Author: Graeme Gill

## spectro/ccxxmake

### Summary

For Colorimeters that rely on a calibration matrix, ccxxmake allows creation of a correction matrix file (ccmx) for a particular Colorimeter & Display combination, by making use a reference Spectrometer or Colorimeter instrument. This can then be used to improve the accuracy of subsequent measurements with that Colorimeter on that Display by using it with the dispcal, dispread and spotread -X option. A ccmx file can also be installed, and will then appear in the available display type selection (-y option). See Wide Gamut Displays and Colorimeters for more information on why this may be useful. [ Note that to make use of a colorimeter as a CCMX reference, you will have to provide two .ti3 files rather than using interactive measurement- see -f. ]
For Colorimeters that have sensor spectral sensitivity calibration information built into them (ie. the X-Rite i1d3, and DataColor Spyder4), ccxxmake allows a creation of a calibration spectral sample (ccss) for a particular Display, by making use a reference Spectrometer instrument. This can then be used to improve the accuracy of subsequent measurements on that Display using such Colorimeters, by using it with the dispcal, dispread and spotread -X option, or it can be installed, and will then appear in the available display type selection (-y option).
The instrument manufacturer may supply spectral sample files (see oeminst).
There is a list of contributed ccmx (Colorimeter Correction Matrix) files.

### Usage Summary

ccxxmake [-options] correction.ccmx
-v Verbose mode
-S Create CCSS rather than CCMX
-f file1.ti3[,file2.ti3] Create from one or two .ti3 files rather than measure.
-display displayname [X11 only] Choose X11 display name
-d n[,m] [X11 only] Choose the display from the following list (default 1),
and optionally choose a different display m for VideoLUT access.
-d n Choose the display from the following list (default 1)
-dweb[:port] Display via a web server at port (default 8080)
-dmadvr [MSWin] Display via MadVR Video Renderer
-p Use telephoto mode (ie. for a projector) (if available)
-y X Display type - instrument specific list to choose from. (CCMX)
-P ho,vo,ss[,vs] Position test window and scale it
ho,vi: 0.0 = left/top, 0.5 = center, 1.0 = right/bottom etc.
ss: 0.5 = half, 1.0 = normal, 2.0 = double etc.
ss,vs: = optional horizontal, vertical scale.
-F Fill whole screen with black background
-n [X11 only] Don't set override redirect on test window
-N Disable initial calibration of instrument if possible
-H Use high resolution spectrum mode (if available)
-C "command" Invoke shell "command" each time a color is set
-o observ Choose CIE Observer for CCMX spectral data:
1931_2 (def.), 1964_10, S&B 1955_2, shaw, J&V 1978_2
-s steps Override default patch sequence combination steps (default 3)
-W n|h|x Override serial port flow control: n = none, h = HW, x = Xon/Xoff
-D [level] Print debug diagnostics to stderr
-E "description" Override the default overall escription
-I "displayname" Set display make and model description
-T "displaytech" Set display technology description (ie. CRT, LCD etc.)
`-U c Set UI selection character(s)`
-Y r|n Override refresh, non-refresh display mode
`-Y R:rate Override measured refresh rate with rate Hz`
-YA Use non-adaptive integration time mode (if available).
correction.ccmx | calibration.ccss
File to save result to.

### Usage Details and Discussion

The -v flag causes extra information to be printed out during chartread operation.
-S By default a Colorimeter Correction Matrix (CCMX) will be created from both Colorimeter and Spectrometer readings, which allows correction for errors with a particular Colorimeter and Display combination. If the -S flag is used, then instead a Colorimeter Calibration Spectral Set (CCSS) file is created from just the Spectrometer readings, that allows calibrating any suitable Colorimeter to the Display.
-f file1.ti3[,file2.ti3] By default ccxxmake creates a CCMX file by displaying test patches on the screen, and then prompting you to measure them interactively with the two instruments. An alternative is to create a small number of test values using targen suitable for display profiling (or use the ref/ccxx.ti1 file provided with ArgyllCMS), and then measure them with the two instruments using dispread to create a reference and target .ti3 files, and then provide the two files as arguments to ccxxmake -f. Normally the reference file will be created using a spectral instrument and you will want to use the -s flag with dispread for this. If you want to use a colorimeter as a reference instrument, then make sure that it is the first file provided to the ccxxmake -f option. The filenames should be concatenated with a "," separator without spaces. You will also have to supply a display name using the -I option and/or technology description using -T.
When creating a CCSS file, only spectral readings from the display measured with the reference instrument are needed, and a single .ti3 file should be provided.
When running on a UNIX based system that used the X11 Windowing System, ccxxmake will by default use the $DISPLAY environment variable to determine which display and screen to read from. This can be overridden by supplying an X11 display name to the -display option. Note that if Xinerama is active, you can't select the screen using $DISPLAY or -display, you have to select it using the -d parameter.
By default the main display will be the location of the test window. If the system has more than one display or screen, an alternate display/screen can be selected with the -d parameter. If you invoke ccxxmake so as to display the usage information (i.e. "dispcal -?" or "dispcal --"), then the discovered displays/screens will be listed. Multiple displays may not be listed, if they appear as a single display to the operating system (ie. the multi-display support is hidden in the video card driver). On UNIX based system that used the X11 Windowing System, the -d parameter will override the screen specified by the $DISPLAY or parameter.
Because of the difficulty cause by TwinView and MergedFB in X11 based systems, you can optionally specify a separate display number after the display that is going to be used to present test patches, for accessing the VideoLUT hardware. This must be specified as a single string, e.g. -d 1,2 . Some experimentation may be needed using dispwin on such systems, to discover what screen has access to the VideoLUT hardware, and which screens the test patches appear on.
-dweb or -dweb:port starts a standalone web server on your machine, which then allows a local or remote web browser to display the the color test patches. By default port 8080 is used, but this can be overridden by appending a : and the port number i.e. -dweb:8001. The URL will be http:// then name of the machine or its I.P. address followed by a colon and the port number - e.g something like http://192.168.0.1:8080. If you use the verbose option (-v) then a likely URL will be printed once the server is started, or you could run ipconfig (MSWin) or /sbin/ifconfig (Linux or OS X) and identify an internet address for your machine that way.
-dmadvr [MSWin only] causes test patches to be displayed using the MadVR video renderer. Note that you may have to start the video playback software and load a video clip in pause for this to work. MadVR rendering does not need or support VideoLUT access. Test patch colors will be processed by the MadVR 3dLut.
The -p flag allows measuring in telephoto mode, using instruments that support this mode, e.g. the ColorMunki. Telephoto mode is one for taking emissive measurements from a distance (ie. telespectometer, tele-colorimeter) mode, and typically would be used for measuring projector type displays. If a device does not support a specific telephoto mode, then the normal emissive mode may be suitable for measuring projectors.
The -y flag allows setting the Display Type used as a base for color correction matrix CCMX creation. Only base calibration display types will be listed. The selection typically determines two aspects of of the instrument operation: 1) It may set the measuring mode to suite refresh or non-refresh displays. Typically only LCD (Liquid Crystal) displays have a non-refresh nature. 2) It may select an instrument internal calibration matrix suitable for a particular display type. The selections available depends on the type and model of instrument, and a list of the options for the discovered instruments will be shown in the usage information. For more details on what particular instruments support and how this works, see Operation of particular instruments. Any CCMX created will work on top of the selected Display Type, so to be valid, the same Display Type must be selected whenever the CCMX is used with this instrument. Installed CCMX files will automatically select the appropriate base type.
The -P parameter allows you to position and size the test patch window. By default it is places in the center of the screen, and sized appropriately for the type of instrument. The ho and vo values govern the horizontal and vertical offset respectively. A value of 0.0 positions the window to the far left or top of the screen, a value of 0.5 positions it in the center of the screen (the default), and 1.0 positions it to the far right or bottom of the screen. If three parameters are provided, then the ss parameter is a scale factor for the test window size. A value of 0.5 for instance, would produce a half sized window. A value of 2.0 will produce a double size window. If four parameters are provided, then the last two set independent horizontal and vertical scaling factors. Note that the ho,vo,ss or ho,vo,hs,vs numbers must be specified as a single string (no space between the numbers and the comma). For example, to create a double sized test window at the top right of the screen, use -P 1,0,2 . To create a window twice as wide as high: -P 1,0,2,1.
The -F flag causes the while screen behind the test window to be masked with black. This can aid black accuracy when measuring CRT displays or projectors.
-n When running on a UNIX based system that used the X11 Windowing System, dispcal normally selects the override redirect so that the test window will appear above any other windows on the display. On some systems this can interfere with window manager operation, and the -n option turns this behaviour off.
-N Any instrument that requires regular calibration will ask for calibration on initial start-up. Sometimes this can be awkward if the instrument is being mounted in some sort of measuring jig, or annoying if several sets of readings are being taken in quick succession. The -N suppresses this initial calibration if a valid and not timed out previous calibration is recorded in the instrument or on the host computer. It is advisable to only use this option on the second and subsequent measurements in a single session.
The -H option on high resolution spectral mode, if the instrument supports it, such as the Eye-One Pro. See Operation of particular instruments for more details. This may give better accuracy for display measurements.
The -C "command" option allows a method of relaying each test value to some other display than that on the system running dispcal (for instance, a photo frame, PDA screen etc.), by causing the given command to be invoked to the shell, with six arguments. The first three arguments are the RGB test color as integers in the range 0 to 255, the second three parameters are the RGB test color as floating point numbers in the range 0.0 to 1.0. The script or tool should relay the given color to the screen in some manner (e.g. by generating a raster file of the given color and sending it to the display being profiled), before returning. Note that a test window will also be created on the system running dispread.
(CCMX creation) The -o flag allows specifying a tristimulus observer, and is used to compute tristimulus values from spectral readings. 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
The -s steps parameter overrides the default number of test patch combination steps used in measuring a colorimeter & display combination. The steps are those out of every combination of R,G & B values of the given number of steps that have at least one colorant at 100%. So 2 steps gives 7 test patches, 3 gives 19, 4 gives 37, 5 gives 61, 6 gives 91 etc. Note that typically this won't make much difference to the resulting calibration, since it depends primarily on the underlying spectral characteristics of the display.
The -W n|h|x parameter overrides the default serial communications flow control setting. The value n turns all flow control off, h sets hardware handshaking, and x sets Xon/Xoff handshaking. This commend may be useful in workaround serial communications issues with some systems and cables.
The -D flag causes communications and other instrument diagnostics to be printed to stdout. A level can be set between 1 .. 9, that may give progressively more verbose information, depending on the instrument. This can be useful in tracking down why an instrument can't connect.
The -E parameter allows overriding the ccmx/ccss files overall description tag. Normally this is not necessary. 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.
The -I parameter allows setting of the display description string in the resulting ccmx/ccss file. Since the default display description is probably very generic, it is highly recommended that a description of the make and model of the display be provided here, or set a display technology description using -T (see below). The default or given display description will be printed before the menu. 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.
The -T parameter allows setting of the display technology description string in the resulting ccmx/ccss file. The applicability of the calibration mainly depends on the technology type of the display, so a description of the technology (ie. "CRT", "LCD", "LCD + backlight type + LCD type", etc.) is highly recommended, because it can make the calibration more widely usable. 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.
The -U parameter allows setting of the user interface selection character this display type can be selected by, if installed. This character will only be used if there is no clash with any preceding selections. Characters in the range 0-9, A-Z a-z can be used.
The -Y r and -Y n options overrides the refresh display mode set by the -y display type selection, with -Y r forcing refresh display mode, and -Y n forcing a non-refresh display mode. Not all instruments support a display measurement refresh mode, or the ability to override the mode set by the display type selection.
The -Y R:rate options overrides calibration of the instrument refresh rate. This may be useful if the instrument supports this function and the refresh rate cannot be accurately calibrated from the display itself.
The -Y A option uses a non-adaptive integration time emission measurement mode, if the instrument supports it, such as the Eye-One Pro or ColorMunki. By default an adaptive integration time measurement mode will be used for emission measurements, but some instruments support a fixed integration time mode that can be used with display devices. This may give increased consistency and faster measurement times, but may also give less accurate low level readings.
The correction.ccmx is the name of the file to save the resulting Colorimeter Correction Matrix to. It is best to give it a short but informative name that includes the Colorimeter model and the display make and model. By convention it should have a .ccmx file extension.
The correction.ccss is the name of the file to save the resulting Colorimeter Calibration Spectral Samples to. It is best to give it a short but informative name that includes the display technology or model. By convention it should have a .ccss file extension.
If you are going to use the same CCMX or CCSS file all the time, then you may want to set the ARGYLL_COLMTER_CAL_SPEC_SET environment variable.

### Instrument Communications:

Unlike the other measurement utilities, ccxxmake doesn't connect to the instrument until it is about to make a measurement. This allows for the possibility of using a different instrument for each measurement.
It will display a menu:
Press 1 .. 4:
1) Select an instrument, Currently 1 'usb:/bus4/dev2/ (GretagMacbeth i1 Pro)'
2) Measure test patches with current instrument
3) [ Compute Colorimeter Correction Matrix & save it ]
4) Exit
For creating a CCMX there are two measurements to be made, after which the correction matrix can be computed and saved. Before each measurement, the instrument may need calibrating. For creating a CCSS a single measurement is needed.
A spectral measurement using a spectral instrument is always needed.
A measurement using the Colorimeter that the correction matrix is being created for is needed in the case of creating a CCMX, but not needed when creating a CCSS.
There will be a message before the menu indicating which of the measurements has been completed.

#### Display Setup:

Because ccmx/ccss is measuring spectral matching, the exact levels of each channel is not important, so the display settings or calibration state shouldn't make any difference to the result, as long as it is the same for the readings of both instruments. Similarly, the number and variety of test patches shouldn't make a huge difference, as long as there is at least Red, Green, Blue and White test patches.