spectro/dispcal

Summary

Given calibration target information [white point, maximum brightness, and response curve ("gamma")], display a series of test patches on the display, and using the colorimetric values read, create a calibration lookup tables that make the display meet the desired target.

Usage

dispcal [-options] inoutfile
 -v                   Verbose mode
 -display displayname [X11 only] Choose X11 display name
 -d n                 Choose the display from the following list (default 1)
  -c listno            Set communication port from the following list (default 1)
 -a                   Run instrument calibration
 -r                   Report the current display calibration then exit
 -m                   Skip adjustment of the monitor controls
 -u [profile.icm]     Update previous calibration [update profile with new calibration]
 -i 92|94|SO          Select target instrument (default DTP92)
                      92 = DTP92, 94 = DTP94, SO = Spectrolino
 -q [lmhu]            Quality - Low, Medium (def), High, Ultra
 -y c|l               Display type, c = CRT, l = LCD
 -t [temp]            White Daylight locus target, optional target temperaturee in deg. K (deflt.)
 -T [temp]            White Black Body locus target, optional target temperaturee in deg. K
 -w x,y               Set the target white point as chromaticity coordinates
 -b bright            Set the target brightness in cd/m^2
 -g gamma             Set the target response curve gamma (Def. 2.2)
                      Use "-gl" for L*a*b* curve
                      Use "-gs" for sRGB curve
 -k factor            Amount to try and correct black point. Default is 1.0
 -e                   Run verify pass on final curves
 -E                   Run only verify pass on current display setup
 -p ho,vo,ss          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.
 -n                   [X11 only] Don't set override redirect on test window
 -N                   Disable auto calibration of instrument
 -D                   Print debug diagnostics
 inoutfile            Base name for input/output[.cal] file.

Comments

This is the utility is used for calibrating a display, to reach specified target behaviour.  For best results on a CRT, you should run this against a neutral grey desktop background, and avoid having any bright images or windows on the screen at the time you run dispcal

The -v flag reports progress information, as well as other statistics about the progress of calibration.

When running on a UNIX based system that used the X11 Windowing System, dispcal 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 dispcal 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 -display parameter.

-c The instrument is assumed to communicate through a USB or serial communication port, and the port can be selected with the -c option, if the instrument is not connected to the first port. If you invoke dispcal so as to display the usage information (i.e. "dispcal -?" or "dispcal --"), then the discovered USB and serial ports will be listed. On UNIX/Linux, a list of all possible serial ports are shown, but not all of them may actually be present on your system.

The -a option runs through the black and sensor relative calibration routines for the Xrite DTP92 and DTP94 instrument. If a Spectrolino is being used, then a white and black calibration will always be performed before the instrument can be placed on the display, unless the -N flag is used.

The -r option performs a measurement of the current display calibration, reports it and then exits. The information reported is:

    Black Brightness in cd/m^2
    White Brightness in cd/m^2
    The approximate Gamma
    The white point x,y chromaticity co-ordinates
    The correlated color temperature in Kelvin, and the CIEDE200 to the Black Body locus.
    The correlated Daylight temperature in Kelvin, and the CIEDE200 to the Daylight locus.
    The visual color temperature in Kelvin, and the CIEDE200 to the Black Body locus.
    The visual Daylight temperature in Kelvin, and the CIEDE200 to the Daylight locus.
    The visual color temperature in Kelvin

Note that the correlated color temperature is the temperature of a black body radiator that has the closest color to the white point measured using the traditional CIE 1960 UCS space color difference formula. The correlated daylight temperature is a similar thing, except the CIE daylight locus is used. The visual color temperature values are calculated similarly to the correlated color temperatures, but using the modern CIEDE2000 color difference formula to calculate a better visual approximation to the closest temperature to the displays white point. There will be no difference between the UCS and CIEDE2000 temperatures if the display white point actually lies on the particular locus.

The -m option skips the usual process of adjusting the display monitor contrast, brightness and white point controls.

-u Normally dispcal creates a new calibration file, based on the requested targets, and the response of the display. This can take a fair amount of time, particularly if a high quality level has been selected, so to speed up the process of keeping a display in calibration the -u flag can be used. This uses the same calibration targets as the previous calibration but does a smaller number of refinement passes, enough to improve the accuracy of the calibration to account for drift in the device. If a display ICC profile is provided as an argument to -u, then the vcgt tag within the profile will be updated with the new calibration. This keeps the profile up to date with the display. Normally dispcal -u will use the same quality level that was specified in the previous calibration, but this can be overridden using the -q flag. Any options that attempt to change the calibration target (ie. white point, brightness, gamma etc.) will be ignored. Adjustment of the display monitor controls is skipped.

-i By default dispcal will either determine the type of instrument if a USB port is selected, or for serial ports, one must be selected using the -i parameter. Note that the DTP92 and DTP94 are colorimeters, and cannot read spectral information, and that the DTP92 can only read CRT type displays.

  Quality - Low, Medium (def), High, Ultra. The -q flag determines how much time and effort to go to in calibrating the display. The higher the quality, the more test readings will be done, the more refinement passes will be done, and the more detailed will be the calibration of the display.

-y Display type. Some colorimeters (like the DTP94) can do a more accurate job if they know what type of display technology is used. Use -yc if you are calibrating a CRT (Cathode Ray Tube) type monitor, and use -yl if you are calibrating an LCD (Liquid Crystal Display).

-t Set the target white point locus to the equivalent of a Daylight spectrum of the given temperature in degrees Kelvin. By default the white point target will be the native white of the display, and it's color temperature and delta E to the daylight spectrum locus will be shown during monitor adjustment, and adjustments will be recommended to put the display white point directly on the Daylight locus. If a Daylight color temperature is given as an argument to -t, then this will become the target of the adjustment, and the recommended adjustments will be those needed to make the monitor white point meet the target. Typical  values might be 5000 for matching printed output, or 6500, which gives a brighter, bluer look. The lower white point temperatures may limit the maximum brightness possible.

-T Same functionality as the -t option, except the white point locus will be the Black Body, or Planckian locus, rather than the Daylight locus. While these two white point loci are quite close, they are subtly different. If a temperature is given as an argument, this will become the Black Body target temperature during adjustment.

-w An alternative to specifying a  white point target in Daylight or Black Body degrees Kevin, is to specify it in chromaticity co-ordinates. This allows the white point to be a color other than one on the Daylight or Black Body. Note that the x,y numbers must be specified as a single string (no space between the numbers and the comma).

-b Set the target brightness of white in cd/m^2. If this number cannot be reached, the brightest output possible is chosen.

-g Set the target response curve gamma. This is normally an exponential curve (output = input ^gamma), and defaults to 2.2, a standard sort of value. Two alternatives to the power curve are to use the sRGB curve response curve, which is an exponent curve with a straight segment at the dark end (-gs), or the L* curve, which is the response of the CIE L*a*b* perceptual colorspace (-gl).

-k Normally dispcal will attempt to make all colors down the neutral axis (R=G=B) have the same hue as the chosen white point. Near the black point, red, green or blue can only be added, not subtracted from zero, so the process of making the near black colors have the desired hue, will lighten them to some extent. For a device with a good contrast ratio or a black point that has nearly the same hue as the white, this is not a problem. If the device contrast ratio is not so good, and the black hue is noticeably different to that of the chosen white point, this could have a noticeably detrimental effect on an already limited contrast ratio. The -k flag allows the amount of black point hue correction to be controlled. By setting it to less than 1.0, you can reduce the the neutral hue matching near the black point, and improve the the contrast ratio. Set the factor to 0.0 to use the native black point.

-e Run verify pass on the final curves. This is an extra set of instrument readings, that are used to estimate how well the device will match the targets with the computed calibration curves.

-E Run verify pass on the display as it is currently setup (current LUT curves). This will use the usual input parameters to establish the expected (target) characteristic. You can use dispwin to load a .cal file into the display before running dispcal -E.

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. 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. Note that the ho,vo,ss 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 .

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

The -N flag disables any automatic instrument calibration (used for the Gretag Spectrolino for instance). This would be used when the instrument is being used for a series of measurements, and it is inconvenient to place it on it's calibration tile between measurements. The instrument should be calibrated at least once prior to each measurement session though.

The -D flag causes serial communications diagnostics to be printed to stdout. This can be useful in tracking down why an instrument can't connect.

inoutfile The final parameter on the command line is the base filename for the .cal file. Normally this will be created (or an existing file will be overwritten). If the -u flag is used, then this file will be updated.



The adjustment of the display controls (brightness, contrast, R, G & B channel controls etc.) is very dependent on the particular monitor. Different types and brands of monitors will have different controls, or controls that operate in different ways.

Almost all LCD displays don't have a real contrast control. Those that do present such a control, generally fake it by adjusting the video signal. For this reason it is usually best to set an LCD's contrast control at its neutral setting (ie. the setting at which it doesn't change the video signal). Unfortunately, it can be hard to know what this neutral setting is. On some displays it is 50%, others 75%. If the LCD display has a "reset to factory defaults" mode, then try using this first, as a way of setting the contrast control to neutral. The LCD brightness control generally adjusts the level of backlighting the display gets, which affects the maximum brightness, and also tends to raise or lower the black level in proportion, without changing the displays response curve shape.

On CRT based displays, the brightness control generally adjusts the black level of the display, and as a side effect, tends to change the maximum brightness too. A CRT contrast control generally adjusts the maximum brightness without affecting the black level a great deal. On a CRT both the brightness and contrast controls will tend to affect the shape or gamma of the display response curve.

Many displays have some sort of color temperature adjustment. This may be in the form of some pre-set color temperatures, or in the form of individual Red, Green and Blue channel gain adjustments. Some displays also have R, G & B channel offset adjustments that will affect the color temperatures near black, as well as affect the individual gun's curve shape. Some special LCD displays that have a white point adjustment that changes the color of the backlight. The color temperature adjustment will generally affect the maximum brightness, and may also affect the black level and the shape of the display response curves.

Due to the variety of controls as well as the interaction between them, it can be an iterative process to arrive at a good monitor set-up, before proceeding on to calibrating and profiling a display. For this reason, dispcal offers a menu of adjustment modes, so that the user can interactively and itteratively adjust the display controls to meet the desired targets.

  1) Black level (CRT: Brightness)
  2) White point (Color temperature, R,G,B, Gain)
  3) White level (CRT: Contrast, LCD: Brightness)
  4) Black point (R,G,B, Offset)
  5) Check all
  6) Continue on to calibration
  7) Exit

There are four basic adjustment modes. Normally one would proceed through them in order, then perhaps repeat the first adjustment, before checking the overall settings. The White point and White level modes operate slightly differently, depending on whether a white target point has been set using the -t -T or -w options, and on whether a brightness target has been set using the -b option.


The first mode lets you adjust the black level of a CRT display. Given the current white level, it calculates a value that should produce a 1% display brightness if the black level is set correctly. After doing some initial measurements, it will show the target brightness value (in cd/m^2) on one line, and then underneath it will show continuously updated readings from the display. The left most character will switch from '\' to '/' and back again each time a reading is updated. Underneath the target value is displayed the current reading, and to the right of this is a '+', '-' or '=' symbol, which gives a hint as to which way to adjust the brightness control to improve the match to the target.

  Adjust CRT brightness to get target level. Press space when done.
     Target 0.60
  / Current 0.68  -


Once happy with the adjustment, press space to go back to the menu.


The second mode lets you adjust the color of the white point of the display. If a target white point has been set, it will show the target brightness value (in cd/m^2) on one line, together with the target chromaticity co-ordinates for the white point, and then underneath it will show continuously updated readings from the display. The left most character will switch from '\' to '/' and back again each time a reading is updated. Underneath the target brightness value is displayed the current reading, and then the current chromaticity co-ordinate values. To the right of this is the current delta E of the white point from the target, and further to the right are hints '+', '-' or '='  as to which direction to adjust the individual Red, Green and Blue gain settings to move the white point in the direction of the target. If the symbol is doubled, then this channel will have the greatest effect. If you do not have individual channel gain controls, then try choosing amongst color temperature pre-sets, to find one with the lowest delta E.

   Adjust R,G & B gain to get target x,y. Press space when done.
     Target B 60.00, x 0.3451, y 0.3516
  / Current B 60.05, x 0.3426, y 0.3506  DE  1.4  R+  G+  B--


If you did not set a white point target, then the display is a little different. it will show the initial white point value, as well as the color temperature, and the CIEDE2000 of the white point to either the Daylight or Black Body locus (depending on whether the -T flag was set). The constantly updated values show the same thing, and the Red, Green and Blue control hints show the direction to adjust the controls to place the white point on the locus. The control that will have the most direct effect on the color temperature will be the Blue, while the Green will most directly move the white point towards or away from the locus (but there is interaction).

Adjust R,G & B gain to desired white point. Press space when done.
  Initial B 47.25, x 0.3417, y 0.3456, CDT 5113 DE  6.9
\ Current B 47.38, x 0.3420, y 0.3460  CDT 5104 DE  6.7  R-- G+  B-


 The brightness value is just there as a guide to what effect the adjustment is having on the overall brightness. Usually the white level brightness is adjusted using the next adjustment mode. Once happy with the adjustment, press space to go back to the menu.


The third mode lets you adjust the brightness of white on the display. If you set a target brightness using the -b parameter, it will show the target brightness value (in cd/m^2) on one line, and then underneath it will show continuously updated readings from the display. The left most character will switch from '\' to '/' and back again each time a reading is updated. Underneath the target value is displayed the current reading, and to the right of this is a '+', '-' or '=' symbol, which gives a hint as to which way to adjust the CRT contrast or LCD brightness control to improve the match to the target.

   Adjust CRT Contrast or LCD Brightness to get target level. Press space when done.
     Target 60.00
  / Current 59.96  +


If you did not set a brightness target, it will show the initial brightness as the target, and the current brightness, which you can then set any way you want.

Adjust CRT Contrast or LCD Brightness to desired level. Press space when done.
  Initial 47.32
/ Current 47.54


Once happy with the adjustment, press space to go back to the menu.


The fourth mode lets you adjust the color of the black point of the display, if the display has Red, Green and Blue channel offset controls. It will show the target 1% brightness value (in cd/m^2) on one line, together with the target chromaticity co-ordinates for the black point, and then underneath it will show continuously updated readings from the display. The left most character will switch from '\' to '/' and back again each time a reading is updated. Underneath the target brightness value is displayed the current reading, and then the current chromaticity co-ordinate values. To the right of this is the current delta E of the black point from the target, and further to the right are hints '+', '-' or '='  as to which direction to adjust the individual Red, Green and Blue offset settings to move the black point in the right direction. If the symbol is doubled, then this channel will have the greatest effect.

  Adjust R,G & B offsets to get target x,y. Press space when done.
     Target B 0.60, x 0.3451, y 0.3516
  \ Current B 0.62, x 0.2782, y 0.2331  DE  10.3  R+  G++ B-


The 1%  brightness value is just there as a guide to what effect the adjustment is having on the 1% brightness level. The combined channel offsets may have an effect on this in combination with the CRT brightness control. Press space to go back to the menu.


The fifth selection checks on the overall settings.  If targets have been set, it will be like:

  Target Brightness = 50.00, Current = 47.44, error = -5.1%
  Target 50% Level  = 10.32, Current =  8.10, error = -4.4%
  Target Near Black =  0.47, Current =  0.68, error =  0.4%
  Target white = x 0.3458, y 0.3586, Current = x 0.3420, y 0.3454, error =  7.55 DE
  Target black = x 0.3458, y 0.3586, Current = x 0.2908, y 0.2270, error = 29.69 DE


or if no targets are set:

  Current Brightness = 46.28
  Target 50% Level  = 10.07, Current =  7.52, error = -5.5%
  Target Near Black =  0.46, Current =  0.46, error = -0.0%
  Current white = x 0.3439, y 0.3466, VCT 5098K DE  3.0
  Target black = x 0.3439, y 0.3466, Current = x 0.3093, y 0.2165, error = 30.30 DE


and will then go back to the menu.

Once  you're happy with the display set-up, you can either proceed on to the rest of the calibration by selecting 6), or exit and re-start by selecting 7). You might want to re-start if you want to change the calibration targets.



The program attempts to stop any screensaver or powersaver from interfering with the measurements, but this may not be effective on some systems, so it may be necessary to manually disable the screensaver and/or powersaver before commencing the measurement of a large number of patches.

The calibration tables produced maintain the maximum level of precision available on a system. If the system RAMDAC outputs are better than 8 bits per component, then the resulting curves can reflect this.

If communications break down with a USB connected instrument, you may have to unplug it, and plug it in again to recover.

Some systems (Apple OSX in particular) have a special set of user interface controls ("Universal Access") that allows altering the display in ways designed to assist visually impaired users, by increasing contrast etc. This will interfere badly with any attempts to calibrate or profile such a system, and must be turned off in order to do so. Note that certain magic keyboard sequences can turn this on by accident.