Argyll CMS を使って ubuntu でも液晶モニタのキャリブレーション


ubuntu でもモニタのキャリブレーションできるよ!


2011年8月下旬、秋葉原のショップインバースでジャンクのレッツノート CF-T5 をわずか 8,000円で買った。既に所持している CF-W5(新品で25万くらいで買った)のサブで ubuntu 専用機が欲しいなーと思ってたところだった。


良い買い物をした。買って一ヶ月以上経つけど、なんの故障もなく使えてるし、バッテリーも4時間はもつし、CoreDuoでそれなりに実用的な速度で動く。外観もそんなに悪くない(上の写真を見て)。でも、ひとつ難点があるとすれば、液晶のバックライトが劣化してきて黄色く見えることだ。モニタを何台も並べていると色の違いが気になる。

モニタを校正することにした。MacWindows なら市販のモニタキャリブレータが使えるけど、Linux (X) でそのままでは使えない。仮想マシンでも LUT が利用できないので無理だろう。ノートだからモニタを外して別のマシンで校正することもできない。


オープンソースCMS アプリケーション Argyll Color Management System を試すことにした。ubuntu 11.10 では apt-get で簡単にインストールできる。適合する古い測色器(x-rite DTP94)が手元にあった。

Argyll は CLI ツールだけど、易しい GUI ラッパー Argyll dispcalGUI も出ている。しかし今回は、パッケージの依存関係を解消するのがだるくて使っていない。

argyll パッケージ内の dispcal を使って校正, icm モニタプロファイルを作成する。
dispcal の man はこちら。

% dispcal -v1 -d1 -c1 -o CF-T5_1.icm -O "CF-T5 display icm profile 1st" -qm -yl -t5000 -p 0.5,0.5,0.5 -K c

測色器をつないでから dispcal を実行してね。

画面の真ん中にカラーパッチが表示されるので、そこに測色器をセットする。

Setting up the instrument
 Instrument Type:  DTP94
 Serial Number:    0238xx
 Boot version:     D929
 Software version: DB06
Want projection measurement capability but instrument doesn't support it
so falling back to display mode.
Place instrument on test window.
Hit Esc or Q to give up, any other key to continue:
Display type is LCD
Target white = 5000.000000 degrees kelvin Daylight spectrum
Target white brightness = native brightness
Target black brightness = native brightness
Target advertised gamma = 2.200000

Display adjustment menu:
Press 1 .. 7
1) Black level (CRT: Offset/Brightness)
2) White point (Color temperature, R,G,B, Gain/Contrast)
3) White level (CRT: Gain/Contrast, LCD: Brightness/Backlight)
4) Black point (R,G,B, Offset/Brightness)
5) Check all
6) Measure and set ambient for viewing condition adjustment
7) Continue on to calibration
8) Exit

実行すると測色器が検出され、ディスプレイの輝度やゲインの設定アシスタントモードになる。*1 このノートPC、もはや最大輝度にしても明るくないし、他に何も調整ポイントがないので skip した(7を押す)。

patch 6 of 6
Black = XYZ   0.61   0.65   0.64
Red   = XYZ  29.09  16.87   2.28
Green = XYZ  19.43  32.60   6.82
Blue  = XYZ   9.84  10.67  39.33
White = XYZ  57.48  59.21  47.50
patch 128 of 128
Initial native brightness target = 59.210000 cd/m^2
Had to scale brightness from 59.210000 to 58.371133 to fit within gamut,
corresponding to RGB 0.998531 1.000000 0.947055
Target white value is XYZ 56.676262 58.371133 44.541255
Adjusted target black XYZ 0.61 0.65 0.63, Lab 9.90 -1.26 -3.71
Target black after min adjust: XYZ 0.610 0.650 0.630, Lab 9.904 -1.260 -3.706
Gamma curve input offset = 0.000000, output offset = 0.011136, power = 2.259617
Total Iteration 3, Final Samples = 64 Final Repeat threshold = 0.600000
Creating initial calibration curves...
Doing iteration 1 with 16 sample points and repeat threshold of 1.200000 DE
patch 16 of 16
Brightness error = -1.261133 cd/m^2 (is 57.110000, should be 58.371133)
White point error = 1.024338 deltaE
Maximum neutral error (@ 1.000000) = 1.319932 deltaE
Average neutral error = 0.795555 deltaE
Failed to meet target 1.200000 delta E, got worst case 1.319932
Number of measurements taken = 44
Computing update to calibration curves...
Doing iteration 2 with 32 sample points and repeat threshold of 0.848528 DE
patch 32 of 32
Brightness error = -1.601133 cd/m^2 (is 56.770000, should be 58.371133)
White point error = 0.998361 deltaE
Maximum neutral error (@ 1.000000) = 1.457514 deltaE
Average neutral error = 0.595230 deltaE
Failed to meet target 0.848528 delta E, got worst case 1.457514
Number of measurements taken = 63
Computing update to calibration curves...
Doing iteration 3 with 64 sample points and repeat threshold of 0.600000 DE
patch 64 of 64
Brightness error = -1.991133 cd/m^2 (is 56.380000, should be 58.371133)
White point error = 1.014456 deltaE
Maximum neutral error (@ 1.000000) = 1.669090 deltaE
Average neutral error = 0.483882 deltaE
Failed to meet target 0.600000 delta E, got worst case 1.669090
Number of measurements taken = 219
The instrument can be removed from the screen.
Written calibration file 'c.cal'
Luminance XYZ = 0.000000 58.854391 0.000000
White point XYZ = 0.968459 1.000000 0.790729
Black point XYZ = 0.010818 0.011650 0.011543
Created fast shaper/matrix profile 'lib/CF-T5_1.icm'

どれどれ…見た目 相当ましになってる!

できたプロファイルは以下のようにしても反映できる。

% xcalib CF-T5_1.icm

プロファイルを無効にするには

% xcalib -clear

see also man (1) xcalib : xcalib


もっと酷いガンマカーブを想像してたので、こんなもので収まってるんだなとむしろ感慨深い。少し暗くなったけど、白い画面も気持ち良く見られるようになった。

ちなみに i1 display 2 はなぜか検出されなかった。検索すると使えてるっぽい記述があるので手元の環境の問題かもしれない。関係ないけど xrite 社のサポート電話番号は土曜休みみたいで今日はかからなかったぞ。

*1:測色器が検出されないとエラーで終了するので、/var/log/syslog とかをみて適宜検出されるようにする。測色器の名前と linux とかキーワードで検索すれば解決するかもしれない。udev が何か奪ってるのかも知れない。