Subversion Repositories Scribus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2454 craig 1
 
2
 
3
                        little cms Engine
4
                    http://www.littlecms.com
5
 
6
           lprof - A profile construction set library
7
 
8
               How to use the the sample profilers
9
 
10
                         by Marti Maria
11
 
12
                            Ver 1.09
13
 
14
        ---------------------------------------------------
15
 
16
 
17
 Welcome to this small guided tour on littlecms sample profilers.
18
 The goal of this document is to show how these programs can be
19
 used to generate ICC profiles for your monitor, scanner, digital
20
 camera, film projector or input device. It has also some advice
21
 on color management in general, as well as some guidelines on
22
 how to handle several littlecms utilities.
23
 
24
 
25
 Since the best way to see how it works seems to be by example, we
26
 will step by step make a whole calibration procedure for monitor
27
 and scanner.
28
 
29
 In all this tour, we will make extensive use of the measurement
30
 and proof utility: qtMeasurementTool. You will also need a IT8
31
 target, available from several vendors. If you plan to do scanner
32
 profiling, make sure to get one of these.
33
 
34
 qtMeasurementTool is a "virtual colorimeter" that used in
35
 conjunction with a proper scanner profile can be used as a cheap
36
 replacement of expensive hardware. It can also be used to proof
37
 an Image across two profiles. The most simple way to check if
38
 all is going fine is by visual inspection. You can load a Image
39
 in the measurement tool, and apply a transform between your
40
 input profile (AKA, scanner or camera) and your monitor profile.
41
 Since right now we have no profiles to check, we should first
42
 create a profile for our monitor.
43
 
44
 This is done by qtMonitorProfiler. This program can work in two
45
 different modes. The "advanced" mode, that gives accurate
46
 profiles by using hardware devices like X-Rite DP92 or EyeOne,
47
 and the "simple" mode, that allow to build reasonably accurate
48
 profiles without any additional hardware.
49
 
50
 
51
 Building a monitor profile: a coarse approximation
52
 ==================================================
53
 
54
 So, let's build our first monitor profile to check how all this
55
 stuff works. We don't need right now a big accuracy. We want to
56
 calibrate coarsely, just to visually check if is all going ok.
57
 
58
 After installing the package, type
59
 
60
                    ./qtmonitorprofiler
61
 
62
 This will start the monitor profiler application. As said, we
63
 need only a coarse profile, so, we select the radio button
64
 labeled:
65
 
66
  "I want to build a coarse profile, giving approximate values"
67
 
68
 This is selected by default. We need not any measurement right
69
 now, only a few visual adjusts. Press the button labeled:
70
 
71
                     "Enter monitor values"
72
 
73
 You will see the monitor values page. In order to obtain maximum
74
 performance, we need to adjust first the physical monitor
75
 controls.
76
 
77
 Set contrast to near maximum, (yes, near maximum. This is the
78
 gain of monitor and we need as many as monitor can deliver) and
79
 then adjust brightness until you can see all grays of a
80
 grayscale. Leave the monitor alone, and return to monitor
81
 profiler program.
82
 
83
 Now we will adjust gamma correction. This is by far the most
84
 important setting. On our first approach, we will try with only
85
 one gray channel (make sure "Link channels" is checked).
86
 
87
 Move the slide until the central frame seems to "fade" on background.
88
 Don't  spend too much time adjust it, gamma varies with many factors.
89
 A coarse adjust will be enough right now.
90
 
91
 You should obtain a typical value of 2.1-2.4, in some cases it
92
 could be even lower.
93
 
94
 Now we go on the white point stuff. Some monitors refers white
95
 point as "temperature". Most users does have white point set to
96
 D93 in order to get more bright, unfortunately this  restricts
97
 the gamut and adds a big quantity of blue, so my advice would be
98
 to select something lower.
99
 
100
 If you can switch temperature of your monitor, D65 (near 6500K)
101
 could be a good choice for multiuse. For proofing devices, D50
102
 is almost a must, but it adds too yellow for a unadapted used.
103
 D50 requires a dim or dark room to give the best results. If you
104
 don't know which temperature your monitor has, select D65 or
105
 D93. On our fist approach both these will give reasonable
106
 results.
107
 
108
 
109
 
110
 If your monitor has any other white point, you can select "User
111
 defined", the last option. You can then select your particular
112
 white point as a temperature in Kelvin degree.
113
 
114
 Don't use CIE illuminants. They are intended for  workspace
115
 construction, and will be discussed latter.
116
 
117
 Next adjust is primaries set. For the primaries, select the
118
 default ITU/R BT.709 if you are profiling a CRT monitor. There
119
 are primaries for Samsung TFT and LCD, but these devices are not
120
 fully supported by the profiler. The reason to not support them
121
 is the angular dependence, which makes them unusable for color
122
 management tasks.
123
 
124
 Other primaries are for building workspaces. If you don't know
125
 the primaries, don't worry. Use the default ITU/R BT.709. There
126
 are 6 or 7 CRT tube manufacturers in the world, and all them
127
 does use this set.
128
 
129
 Now you can fill the info about your monitor. Although this is
130
 not strictly required, it could prevent a lot of pain when you
131
 have more than a couple of profiles.  For filling the info field,
132
 select the "profile identification" tab, and be creative on your
133
 comments!
134
 
135
 Now we are ready to generate our profile. We must specify the
136
 output filename, so, select the "Main" tab, and press the "..."
137
 button on right side of the "output profile file" edit.
138
 
139
 Select "profiles" directory. This is where other tools will look
140
 for monitor profile. There are a couple of profiles there, leave
141
 them alone. For the name, we could use "CoarseMonitor.icm" So,
142
 type in the name and then proceed to generate the profile by
143
 pressing the "GO!" button. If all is ok, the status console will
144
 show "Profile DONE!"
145
 
146
 Let's now check how well is working our profile by eye. For
147
 that, we need another tool. So, close the monitor profile and
148
 start the measurement tool by typing
149
 
150
                       ./qtMeasurementTool
151
 
152
 This utility has many usage. One would be to "proof" a color
153
 transform. Let's first configure the measurement tool. Select
154
 the "Options" tab. Adjust the default settings as following:
155
 
156
          On "Pick template"   --> "Empty Picker"
157
 
158
          On "Input profile"   --> "Tutorial Workspace"
159
 
160
 On "Monitor profile" should appear your profile. If you filled
161
 the info fields, here will be your description. If you didn't
162
 enter description it will be"(unknown) - Little cms construction
163
 set", which is the default string. Now you know why to fill
164
 information fields!
165
 
166
 
167
 
168
 We are going to check your profile with a highly tweaked sample
169
 Image This is a counterexample on what a good workspace should
170
 be. NEVER use this profile for practical purposes!
171
 
172
 Ok, let's see how a Image looks in this tweaked colorspace.
173
 Select the "Image" tab, and press "Load Image" button.
174
 
175
 Select "pics" directory. There is a "party_4s.png" Load it. You
176
 will see the raw, non color managed picture. Since the encoding
177
 space of this Image is quite different of any monitor, the
178
 images looks "flat" and "washed out" Now press the "Proof"
179
 button. The Image is shown using color management. Color
180
 changes should be noticeable, despite gamma of image is
181
 near gamma of monitor.
182
 
183
 
184
 Building scanner profile
185
 ========================
186
 
187
 We have now our monitor calibrated, and will try to generate a
188
 scanner profile. For this, we will also need the measurement
189
 tool.
190
 
191
 Scanner profiles are built by using a thing known as "IT8
192
 target". IT8 targets are just a photo with a set of color
193
 patches. There are known colorimetric measurements for each
194
 of these patches. There is also a standard way to specify
195
 these measurements, the IT8/CGATS format.
196
 
197
 
198
 IT8/CGATS is a way to encode data that is both, human and
199
 machine readable. You can open any of these IT8 reference sheets
200
 with your text editor to see it. You can even modify the
201
 contents. Since it is a standard, most color management systems
202
 does accept it. For these reasons, seems a good way to store
203
 measurement data.
204
 
205
 
206
 A IT8 file does contain measurements for a set of color patches.
207
 The measurement of each patch can be the device colorant values
208
 (the RGB or CMYK in 0..255 range) the tristimulous values (XYZ
209
 or Lab) and some statistic data.
210
 
211
 
212
A IT8 sheet looks like:
213
 
214
-----------------------------------------------------------
215
IT8.7/2
216
ORIGINATOR "Wolf Faust"
217
DESCRIPTOR "L* a* b* Batch average data (light D50, viewing angle 2)"
218
MANUFACTURER "Wolf Faust - http://www.coloraid.de"
219
CREATED "January 07, 2002"
220
PROD_DATE "2001:12"
221
SERIAL "DIN A4  R012020"
222
MATERIAL "Kodak Professional Digital 3 - Non-Glossy"
223
NUMBER_OF_FIELDS 9
224
BEGIN_DATA_FORMAT
225
SAMPLE_ID   XYZ_X   XYZ_Y   XYZ_Z          LAB_L   LAB_A   LAB_B          LAB_C   LAB_H
226
END_DATA_FORMAT
227
NUMBER_OF_SETS 288
228
BEGIN_DATA
229
A1           3.25    2.71    1.94          18.86   11.18    2.87          11.55   14.41
230
A2           4.07    2.73    1.60          18.91   23.59    6.54          24.49   15.48
231
A3           5.79    3.42    1.75          21.67   33.38    9.60          34.73   16.05
232
A4           4.28    2.66    1.46          18.62   27.73    7.59          28.75   15.32
233
A5          11.97   10.30    7.42          38.38   15.04    4.16          15.61   15.47
234
.... etc ...
235
------------------------------------------------------------
236
 
237
 
238
 The target manufacturer does provide a IT8 file containing these
239
 measurements for the target. So, the target is giving to us a set
240
 of KNOWN colors. We must then, tell to the profiler which RGB
241
 values our scanner returns for each of these patches.
242
 
243
 Measurement tool can generate sheets with the RGB values of each
244
 patch grabbing them from a Image. In order to generate a
245
 profile, we need the RGB and Lab values for each patch.
246
 
247
 let's outline the scanner profiling procedure:
248
 
249
      * First (and very important!) adjust controls of scanner to
250
        obtain a proper exchange space.
251
 
252
      * Scan by means of you scanning software a Image of your
253
        target.
254
 
255
      * By using measurement tool, grab the RGB values of each
256
        patch. Store them in a IT8 file
257
 
258
      * The scanner profile then will compare the RGB
259
        obtained by the scanner, with the known colorimetric
260
        measurement of target, as stored in vendor's reference
261
        sheet.
262
 
263
      * The scanner profiler will create a model for the
264
        translation RGB -> Lab or RGB -> XYZ and will store it in
265
        a profile.
266
 
267
 
268
 The math behind this model is not trivial. There is a big
269
 quantity of factors taken into account. Don't worry for the
270
 apparent missing of data. Yes, there are colors not present in
271
 target, however the scanner profiler is capable to "guess" or
272
 extrapolate them, and should produce a profile handling all
273
 gradients between these colors in a smooth and pleasant way.
274
 
275
 Lets' discuss each step in detail:
276
 
277
      * Step 1: Adjust controls of scanner.
278
 
279
 You will need 24 bits per pixel at least. Gray profiles
280
 are NOT supported in this revision.
281
 
282
 There is a big amount of controversy about how to set the
283
 scanner controls. Some people does advice to use linear gamma
284
 (gamma=1.0), which is a wrong advice unless you are working with
285
 16 bits per sample (48 bits per pixel)
286
 
287
 If you are going to scan in 8 bits per sample (24 or 32 bits)
288
 your best choice is a gamma between 2.2 and 3.0
289
 
290
 Gamma 2.2 has the additional benefit of being close to sRGB, and
291
 this means the uncorrected Image will "look nice" on average
292
 monitors. It is also near to perceptual gamma.
293
 
294
 Gamma 2.4 has the additional benefit of being closest to
295
 perceptual space, and this is a very good reason to use this
296
 value.
297
 
298
 Less that 2.2 (and of course the infamous 1.0) can generate huge
299
 loss of detail in shadows, only to give a slight bettering of
300
 highlights. Don't use this unless your are using 16 bits per
301
 sample, and even in such case, don't do it unless you know what
302
 are you doing!
303
 
304
 More that 2.4 (up to 3.0) drops too much highlight to be safe,
305
 despite you will still see the Image quite correct.
306
 
307
 More on controls: Turn off all color management, color enhancing
308
 and tweaking on scanner driver. Set brightness contrast and hue
309
 (if available) to default values. It is supposed this will be your
310
 working scanning mode, so set all to reasonable defaults.
311
 
312
 IMPORTANT: The profile will only be valid with those settings!
313
 
314
 
315
      * Step 2: Scan the IT8 target.
316
 
317
 Store it in PNG, TIFF, BMP on depending of supported formats of
318
 your platform. DON'T use JPEG! Its lousy nature makes it
319
 unsuitable for this purpose. You could use JPEG on final images,
320
 but not in profiling process.
321
 
322
      * Step 3: Extract the RGB values for each patch.
323
 
324
 Without help, this could be a huge task. There are plenty of
325
 patches and taking each sample by hand would be tedious. With
326
 the help of measurement tool, this is a easy task.
327
 
328
 Start the measurement tool by typing
329
 
330
        ./qtMeasurementTool
331
 
332
 Press "Load Image" button. Select the Image of target you scanned
333
 in step 2. I will use the scandmo.png image sited on "pics"
334
 directory as sample. This is a Kodak film target, scanned with a
335
 scanner that adds a huge violet cast. Don't worry, the profile
336
 will turn this one to a nice looking Image.
337
 
338
 Since this is a Kodak target that has some additional patches
339
 (those on I,J,K,L - 20,21,22) we can choose a picker template
340
 according the nature of target. Press "Options" tab, and in the
341
 combo labeled "Pick template" select:
342
 
343
               "IT8.7 19+3 (Kodak) column picker"
344
 
345
 Press "Image" tab.
346
 
347
 You will see a lot of green rectangles. Using the mouse you
348
 must place the pick template over the patches. Use left button to
349
 move whole template and right button to resize it. Since this
350
 Image is not perfectly horizontal, you may want to "unshear" the
351
 layout: You can do it by pressing "Ctrl" key while dragging with
352
 left mouse button.
353
 
354
 The "hot area" is marked with green rectangle. Assure all green
355
 rectangles are inside patches. Failure to do so could result in
356
 wrong profile! You can also adjust the relative size of "hot
357
 areas" by setting the % in "safe frame" on "Options" tab.
358
 Normally there is no need to touch anything.
359
 
360
 Once you were happy with the location of patch grabber zones,
361
 press the "Pick" button, placed on left side of window.
362
 
363
 The measurement tool will build a IT8 sheet containing RGB
364
 values of each of your patches. Now you can save this sheet by
365
 pressing the "Save IT8 sheet" button. For our tutorial I will
366
 name this measurement "scandmo.it8" and will place it on
367
 "pics" directory. (There is already one scandmo.it8, that you
368
 can overwrite)
369
 
370
 Our work with measurement tool is now done. We have right now
371
 the reference sheet of target, which is given by Kodak, and the
372
 RGB values obtained by our scanner. Now we can compare these
373
 files to create a profile.
374
 
375
  * Step 4: Close the measurement tool, and launch the
376
    scanner profiler by typing:
377
 
378
         ./qtScannerProfiler
379
 
380
 From here is quite easy. First we must select the target
381
 reference. In this tutorial, we have used a film target of
382
 reference 1996-08, so, press the "Select target & vendor type"
383
 button and select "targets", "Kodak" folder, then "Emissive"
384
 folder (since it is film). Press Ok. The left combo will be
385
 filled with all target references. Then select 1996-08 (is on
386
 last part of list)
387
 
388
 Once selected, you need to specify your measurement. Press the
389
 "..." button placed on right side of "Measurement" edit. Select
390
 "picts" folder and "scandmo.it8" file.
391
 
392
 Now we have to specify the profile filename. Press the "..." button
393
 placed on right of "output profile file", select the "profiles"
394
 folder. The name could be "scandmo.icm"
395
 
396
 You can now, as we did in the monitor profile, fill some info to
397
 help us to locate the profile latter. Press the "profile
398
 identification" tab, and fill in the fields.
399
 
400
 You are ready to generate the profile. Press "GO!" button to
401
 launch the profiler process. After a few seconds, you will have
402
 a small profile for your scanner. In the demo, the obtained dE is
403
 about 1.24, which is reasonably. Now,  we can better a lot the
404
 error level, but this will take more time to generate the profile.
405
 Press the "Parameters and tweaking" tab, and select on
406
 "Resolution" group "33 points". Then check the checkbox labeled
407
 "local convergence analysis". Press the "GO!" button. Now the
408
 generation will take a while, but the obtained profile has
409
 bettered a lot... maximum dE is about 0.7 and the peak value is
410
 as small as 3!!!
411
 
412
    * Step 5: Let's check how this profile does affect the
413
     original Image.
414
 
415
 Start the measurement tool, select "options" tab and make sure
416
 picker template is set to "empty picker", "input profile" should
417
 be set to this newly created scanner profile, and "monitor
418
 profile" should be the profile we have made for monitor. Press
419
 "Image" tab, press "Load Image" button, load the scanned Image
420
 (scandmo.png in our sample) and then press the "proof" button to
421
 see the results. The girl's Image is dark, this is normal.
422
 However, rest of patches are hugely modified, the grayscale
423
 should appear smooth and without any cast, as well as all violet
424
 tint should disappear.
425
 
426
 
427
 
428
  Making workspace profiles
429
  =========================
430
 
431
 Some applications, for example Adobe Photoshop, does use what is
432
 called "Workspaces". These are RGB color spaces, which are not
433
 intended to be representing any device, nor storage but a
434
 "working space". That is, Image processing operations are
435
 performed in such space, and also can be used as a way to
436
 interchange image data between applications.
437
 
438
 
439
 The monitor profiler, despite its name, can be effectively used
440
 to build such profiles.
441
 
442
 Just select the gamma, primaries set and white point. Press GO!
443
 and the workspace profile will be generated.
444
 
445
 
446
 Building accurate monitor profiles by hardware measurement devices
447
 ===================================================================
448
 
449
 To measure your monitor, you need to fill a IT8 sheet,
450
 containing XYZ measurements for several RGB combinations. A
451
 sample sheet of this kind can be found in "pics" directory. The
452
 file is called "sRGB.IT8" and it measures an ideal sRGB monitor.
453
 
454
 You need to change the XYZ values by those read by your
455
 measurement device. Don't put any Lab value, just RGB and XYZ.
456
 
457
 Please keep the RGB values the sRGB.IT8 has. Optionally, you can
458
 use more patches to assure consistent color reproduction, but make
459
 sure to include at least that ones.
460
 
461
 Note the big amount of gray patches needed. You can also add as
462
 many as you wish, on more gray patches, better linearization
463
 curves control. You must specify at least 16 gray patches.
464
 
465
 Now we will try this procedure, no matter you have not any
466
 hardware device. As we will see below, this method could be used
467
 to dissect profiles and do some tweaking.
468
 
469
 We are going to generate a sRGB profile, by using the sRGB.IT8
470
 measurement sheet. For that, we will use monitor profiler, so
471
 start it by typing:
472
 
473
                       ./qtMonitorProfiler
474
 
475
 Now, we are going to use it in advanced mode. Select the radio
476
 button labeled:
477
 
478
    "I want to build accurate profile from measurement sheet"
479
 
480
 
481
 Then press the "..." button located at right of edit. Select in
482
 "pics" directory the file called "sRGB.IT8". In the "Output
483
 profile file", select a new profile in "profiles" directory.
484
 Call it "my_sRGB.icm".
485
 
486
 I will use this sample to present another utility, the profile
487
 checker. Since the profile checker can understand advanced tags,
488
 we want to include all information in the profile, so select the
489
 "parameters and tweaking" tab, and make sure to select "Verbose,
490
 store anything" in the "profile verbosity level" group.
491
 
492
 Now, fill the info fields if you want (again, I recommend to do
493
 that) and press the GO button. A new "my_srgb.icm" profile will
494
 be created.
495
 
496
 We will check now how accurate is this profile. Start the
497
 profile checker program by typing
498
 
499
                       ./qtProfileChecker
500
 
501
 The profile checker is a tool for inspecting some of profile
502
 internals. In our case, we want to check the accurancy. For
503
 selecting the profile, press the ".." button on the right side
504
 of the "profile" edit. Select "pics" directory, and choose
505
 "my_srgb.icm" profile. Press "GO!" button.
506
 
507
 On "dE report tab" you will see the error statistics. (unless
508
 you forgot to set the profile verbosity to "store anything")
509
 Our sample scored 0.18, which is a incredibly low value, not
510
 to be even reached in real world cases, but this could give
511
 an idea of the precision the profiler can give with only a
512
 very few measurements.
513
 
514
 
515
 The profile checker has also the capability of draw chromaticity
516
 diagram, to show primaries, color displacements, to guess the
517
 gamma of the profile and many other functionality. Feel free to
518
 experiment, the profile checker will never write on your
519
 profile, so you can play with it in a safe way.
520
 
521
 Additional utilities
522
 ====================
523
 
524
 Finally, there is a additional command-line utility that can be
525
 used in conjunction of monitor profiler. It is called icc2it8
526
 and is placed on ICCtoIT8 directory. This utility is capable of
527
 generate IT8 measurements from profiles, so, it can be used as a
528
 "profile tweacker". You can generate a IT8 sheet from a given
529
 profile, then edit manually XYZ values and then build a new
530
 profile using the modified sheet. This right now is limited to
531
 matrix-shaper profiles, but even with this small limitation,
532
 it can become a valuable tool.
533
 
534
 Other useful tools are included in littlecms CMM package.
535
 You have TIFFICC that can be used to apply profile transforms
536
 to TIFF files, and JPEGICC that does same on JPEG. Also,
537
 you have ICCTRANS, that can be used to check profiles
538
 by numbers. See the littlecms documentation for more details.
539
 
540
 
541
 That's all for now. There are still many options that this small
542
 introduction don't cover, like the CIECAM97s appearance model,
543
 and a more advanced usage. However, you have now a basic
544
 knowledge of how this stuff works. There is a mailing list on
545
 littlecms for asking and sharing your tricks on how get the best
546
 from littlecms profilers. Feel free to ask.
547
 
548
      http://lists.sourceforge.net/lists/listinfo/lcms-user
549
 
550
 
551
  Enjoy!