Introducing the ColorHug

Calibrating the ColorHug

To calibrate the ColorHug against a new screen technology you need a photospectrometer, e.g. a ColorMunki and the xcalib software installed.

Always ensure the display has been powered on for at least 30 minutes to ensure the display colors have stabilized.

Working out the calibration matrix (easy way)

Launch colorhug-ccmx and then connect your photospectrometer and ColorHug. Assuming both are recognised and a new button Generate CCMX will appear. You can then click the button and the wizard will walk you through the steps to create the CCMX file.

ccmx program

Working out the calibration matrix (hard way)

We first generate a ti1 file containing a list of patches to measure:

$ targen -d3 patches

Then we measure the patches using the photospectrometer which creates a ti3 file from the ti1 file. For this bit you have to attach your photospectrometer to the computer and disconnect the ColorHug. Note, you need to use the -s flag to ensure that the spectral data is saved.

$ dispread -d1 -yl -s patches
$ mv patches.ti3 colormunki-hp-lp240zx-srgb.ti3

Then we measure the reset the screen and device to default, and measure the spectral response using the ColorHug. So, remove the photospectrometer and attach the ColorHug.

$ xcalib -c
$ colorhug-cmd set-calibration-map 0 0 0 0 0 0
$ colorhug-cmd write-eeprom "Un1c0rn2"

$ ENABLE_COLORHUG=1 dispread -d1 -yl patches
$ mv patches.ti3 colorhug-hp-lp240zx-srgb.ti3

With the two .ti3 files, we can generate a colorimeter calibration matrix:

$ export ccxx_desc="HP-LP2480zx-sRGB"
$ export ccxx_ref="colormunki-hp-lp240zx-srgb.ti3"
$ export ccxx_src="colorhug-hp-lp240zx-srgb.ti3"
$ export ccxx_mat="colorhug-hp-lp240zx-srgb.ccmx"
$ ccxxmake -I $ccxx_desc -T LCD -D$ccxx_desc -f $ccxx_ref,$ccxx_src $ccxx_mat

IMPORTANT: You must add the following lines manually to the output .ccmx file:

KEYWORD "TYPE_LCD"
TYPE_LCD "YES"

This CCMX file is the calibration matrix that best fits the display and your specific ColorHug. The calibration matrix may be useful to people who have not got a photospectrometer, and so we're asking people who got the developer discount to send the ccmx file to us so we can incorporate it in future versions of the hardware.

To set the calibration matrix to the ColorHug, you first need to discover a spare calibration slot on the device. By default, slot 0 is the factory calibration, which you can verify with:

$ colorhug-cmd get-calibration 0
description: Factory Calibration
( 1.21	0.18	0.96	)
( 0.46	2.75	-0.50	)
( -0.66	-1.68	6.36	)
$ colorhug-cmd get-calibration 1
Invalid read: retval=0x0c [No calibration] cmd=0x09 (expected 0x9 [get-calibration]) len=2 (expected 62)

So, we want to write our calibration matrix to slot 1, which we do with:

$ colorhug-cmd set-calibration-ccmx 1 colorhug-hp-lp240zx-srgb.ccmx

We want to assign this calibration to be used by default for any sample which is identified as an LCD screen, and use the factory default for the other modes.

$ colorhug-cmd set-calibration-map 1 0 0 0 0 0

If you want a GUI tool to load and switch the CCMX matrices, try colorhug-ccmx.

ccmx program

Now we can test the device on unknown color swatches, using:

$ colorhug-cmd take-readings-xyz 1
R:114.1115 G:90.0162 B:105.0156

Creating a display profile

Now you can either create a display profile using gnome-color-manager or using the following commands.

$ targen -d3 lp2480zx
$ ENABLE_COLORHUG=1 dispcal -v -ql -m -d1 -yl -P 0.5,0.5,1.2 lp2480zx
$ ENABLE_COLORHUG=1 dispread -v -d1 -yl -k lp2480zx.cal -P 0.5,0.5,1.2 lp2480zx
$ colprof -v -A"HP" -M"LP2480zx" -D"HP LP2480zx" -C"Copyright Richard Hughes 2011" -qm -as lp2480zx
$ gcm-import lp2480zx.icc