Monday 18 July 2011

RGB Values Extraction with PatchTool 3.5

In handling of spot colors,  rendering intent used is either Absolute or Relative.
1) Tiff with ProPhoto color space
      Rendering intent :  Absolute or Relative

2) Tiff with aRGB or sRGB color space
      Rendering intent : Relative

 3) Scanned Tiff image with scanner icc profile
       Rendering intent : Absolute
       Illuminant: D50


Following shows the effect due to rendering intent used for RGB value extraction with PatchTool .
Image will be too cool if wrong rendering intent was selected.
Left: correct rendering intent used                                           Right: wrong rendering intent used

Wednesday 8 June 2011

Improving Scanner Color Reproduction

In the previous post, the scanner profile was created with the same 343 patches that were used in MP4.8 for creation of rgb printer profile.


The MP reference patches are evenly distributed in the RGB space. In contrast, PM5 has more reference patches placed along the neutral and the 3 primarily axes, as shown below.


The patches were combined to form a larger reference target for generating  the scanner profile and the effect was analysed.

Results
.  The reference RGB values were extracted from the target112 tiff file.
.  The printed copy with the target112 was measured with a spectrometer, dtp41.
.  The printed copy was scanned and RGB values were extracted.



Conclusion
The extracted RGB values from the scanned data with dedicated scanner profile exhibit good correlation with the spectrometer's measurement data.

Monday 6 June 2011

Better Color Matching with Delicated Scanner Profile

Metamerism is an optical phenomenon which occurs when color of two samples appear to match under one light source (illuminant) and not match under another.

All photographic media are prone to metamerism to some degree.The created scanner profile may work unsatisfactorily if the image to be scanned is of a different material from the reflective IT8 target.

With the appropriate choice of targeting media for scanner profile creation, a high performance scanner icc profile can be generated, as illustrated below.

Test Pattern
Here is the custom test pattern that was used for the evaluation. It consists of total of 112 color patches.

Both plots were generated with the same scale

Profiles Under Evaluation
In the following test, the Test Pattern was printed with CP800 dye-sub printer and with PhotoShop CS4 using custom printer icc profile. It was scanned with an Epson V500 and the acquired image was assigned with the respective scanner profiles before converting to the working color space for RGB values extraction. The extracted RGB values were then compared with the measured data. Comparison was carried out with PatchTool and ΔE2000 standard was used  for checking differences in color matching, whereas actual color measurement was performed with a DTP41.

1) V500 generic profile
2) PM5-IT8, profile was created with Kodak IT8 reflective target.
3) MP-IT8, profile was created with Kodak IT8 reflective target.
4) Arygll-IT8, profile was created with Kodak IT8 reflective target.
5) Arygll-CP800-343, same paper medium was used for both scanner profile creation and test pattern  printout.

Comparing measured data and extracted RGB values


Above results show that reproduction of color for scanner can be improved significantly if the scanner icc profile is created with the same printing media that are used for generating the scanned images.

Tuesday 22 March 2011

Common Abbreviations in Colorimetry

CAM     Color Appearance Model , most recent model is CIECAM02 as of 2008
CGATS Graphic Arts Technologies Standards
cLUT     Color Look Up Table
CIE       CIE is the short for Commission Internationale de l'Eclairage which is the french title of the
              international commission on light
CMM    Color Matching Module
CMS     Color Management System
ICC       International Color Consortium
Lab        Lab is now more often used as an informal abbreviation for CIELAB or CIE 1976 ,
              whose coordinates are actually L*, a*, and b*.
RelCol   Relative Colorimetric
MinCD  Minimum Color Difference
OOG     Out Of Gamut
PCS      Profile Connection Space
TRC      Tone Response Curve
WCS    Windows Color Management

Saturday 19 March 2011

Evaluation of RGB calibration with CT3

Argyllcms 1.3.2
ColorThink Pro 3 [ link ]
Scanner target: Kodak IT8 Q60 reflective
Epson V500 scanner

Comparison:  
                       a) colprof -v -qh -ax scanner
                       b) colprof -v -qh -ax -u scanner
                       c) colprof -v -qh -ax -un scanner
                       d) MP - profile created with Monaco Profiler 4.8


Evaluate device RGB neutrals
  

Enlarged view: near White
 
Enlarged view: near Black


with option -al,  from different perspective
 
Note:
The L-axis represents the ideal neutral gray or R=G=B.  The goal of most gamut mapping algorithms is to map source neutrals to device neutrals. A better calibrated profile would have neutral points stay closer to the neutral axis.

Argyll scanner profiles' AtoB & BtoA tags

Argyllcms 1.3.2
Scanner target: Kodak IT8 Q60 reflective
Commands:
                     a) colprof -v -qh -al scanner
                     b) colprof -v -qh -al -u scanner      (Forces cLUT profile absolute)
                     c) colprof -v -qh -al -un scanner    (Forces cLUT profile absolute but cLUT white &
                                                                             black points will not be extrapolated with matrix)
Option -u
The -u option causes the lut based input profile to be generated in such a way that the lut table defaults to absolute color values, in that the white of the reference chart will be mapped to its absolute value. Any value whiter than the white reference will not be clipped by the profile, wheares values outside the range of the reference chart will be extrapolated.


AtoB tag





BtoA tag



Friday 18 March 2011

Perfect White Point for scanner profile

Perfect White Point for non-Absolte Colorimetric Intents

Monaco profiler 4.8
XYZ: 0.9641876, 1., 0.8248901
Lab: 100.00, -0.018456, 0.017265

PhotoGamutRGB_avg6c.icc  < Link >
XYZ: 0.9641724, 1., 0.8248749
Lab: 100.00, -0.0210935, 0.0184981

a) ArgyIIcms 1.3.2
b) Basiccolor display 4.1.22
c) Epson (perv50_r.icm, perv50_r.icm)
XYZ: 0.9642029, 1., 0.8249054
Lab: 100.00, -0.0158185, 0.016032

Converting from ProPhoto in Photoshop

ProPhoto's negative primaries [ Link ]

ProPhoto uses PCS of XYZ and its primaries have a* and b* values exceeding  the range  -128 to 127.  When converting color in Photoshop, color out of this Lab gamut  space would be cripped to the defined limits.



White Point for ProPhoto
Red: 0.797668, 0.288040, 0.000000
                   [Lab 60.608273, 139.168888, 104.497022]
Green: 0.135193, 0.711884, 0.000000
                   [Lab 87.576439, -186.694184, 150.993860]
Blue: 0.031342, 0.000092, 0.824905  
                   [Lab 0.082699, 90.249204, -172.271644]


ProPhoto colorants

Lack of appropriate Gamut Mapping

Example:

XYZ ( 16.010934 0.663729 138.946202 )
= Lab ( 5.995 180.014 -200.008 )
-->  Lab ( 5.995 127 -128) = aRGB ( 6.425 -67.615 207.751 )
-->  aRGB ( 6.425 0 207.751 )

see  [ link ]

Thursday 17 March 2011

dtp41.cht


BOXES 13
F _ _ 132 520 282 520 285 2144 129 2144
D ALL ALL _ _ 158 1627 126 516 0 0
D MARK MARK _ _ 14 14 129 516 0 0
Y 01 01 A K 125 90 148 540 0 148.7

BOX_SHRINK 3.5

REF_ROTATION -0.443070

XLIST 13
48.773780 0.051474 0.428571
.....
YLIST 68
26.796151 0.033614 0.142857
......
EXPECTED XYZ 11
A01 0 0 0
B01 4.89 3.27 1.6
C01 5.87 3.31 1.33
D01 6.3 3.38 1.19
E01 13.01 11.44 7.64
F01 16.14 11.99 6.81
G01 19.35 12.41 6.06
H01 20.41 11.97 5.3
I01 43.5 42.81 32.65
J01 45.58 42.37 30.95
K01 48.99 43.2 29.9

Another example

BOXES 13
F _ _ 28 510 390 510 390 2144 28 2144
D ALL ALL _ _ 158 1627 126 516 0 0
D MARK MARK _ _ 14 14 129 516 0 0
X A A 01 11 125 90 148 540 5 148.7

BOX_SHRINK 3.5

REF_ROTATION -0.443070

XLIST 13
48.773780 0.051474 0.428571
.....
YLIST 68
26.796151 0.033614 0.142857
.....
EXPECTED XYZ 11
A01 0 0 0
A02 4.89 3.27 1.6
A03 5.87 3.31 1.33
A04 6.3 3.38 1.19
A05 13.01 11.44 7.64
A06 16.14 11.99 6.81
A07 19.35 12.41 6.06
A08 20.41 11.97 5.3
A09 43.5 42.81 32.65
A10 45.58 42.37 30.95
A11 48.99 43.2 29.9

Notes:
a) Number of Boxes = Expected number of patches + 2
b) The generated number of labels = Expected number of patches

Considerations in creation of Input profiles

Choice of PCS (Profile Connection Space)
For practical consideration, ICC has imposed L*a*b* encoding range of -128 to +127 for values  a* and b* [link].  In reality, those out of range colors are not imaginary but visible and they can be encoded in a  PCS of XYZ  icc profile.

[ Negative primaries ]
ProPhoto primaries have either a* or b* that exceed the -128 to 127 range, as shown below.

Red: 0.797668, 0.288040, 0.000000      [Lab 60.608273,  139.168888, 104.497022]
Green: 0.135193, 0.711884, 0.000000   [Lab 87.576439, -186.694184, 150.993860]
Blue: 0.031342, 0.000092, 0.824905     [Lab   0.082699,   90.249204, -172.271644]


[ colprof ]
colprof  with options -a, -u and -un
-a lxXgsmGS Algorithm type override
                      l = Lab cLUT (def.), x = XYZ cLUT, X = display XYZ cLUT + matrix
                     g = gamma+matrix, s = shaper+matrix, m = matrix only,
                     G = single gamma+matrix, S = single shaper+matrix

Option -al
Default option, cLUT profile will be created with PCS of L*a*b*. Profiles that are generated with this option support all the four rendering intents.

Option -ax
This option allows cLUT profile to be created with PCS of XYZ which offers better accuracy for input devices such as displays, scanners and cameras. In general, it avoids clipping of values above the white point that can occur in L*a*b* based cLUT input profile.

Option -u
Forces cLUT profile absolute.

Option -un
Forces cLUT profile absolute but cLUT white & black points will not be extrapolated with matrix.


cLUT Lab bsed Profiles, illustrated with Lab co-ordinates, relative rendering and showing white point at L=100 (same scale) 
  Profile                Gamut Volume (absolute intent) recorded with CT3
-qh -al                                              2,336,270
-qh -al -u                                          3,148,510
-qh -al -un                                        2,538,190

-qh -ax                                             2.230,620
-qh -ax -u                                         2,443,380
-qh -ax -un                                       2,360,950

Wednesday 16 March 2011

Argyll .cht template

[ .cht format ]
The .cht file recordes the image recognition information that is to be used  by scanin for extracting the rgb values from tiff image file. A preliminary .cht file can be generated by running scanin with -g option, cleaning up with a text editor and adding the necessary key words, parameters and references.

defining the main template
  
setting Diagnostic Box 1

setting Diagnostic Box 2


kl lxs lxe  lys lye     w       h       xo      yo       xi      yi
Y  01  19    A   H    25.625  25.625   26.625  26.625   25.625  25.625
Y  01  22    I   L    25.625  25.625   26.625 231.625   25.625  25.625
X GS00 GS23  _   _    25.625  51.250    2.000 358.750   25.625   0.000
  

w,h       width and height of each sample box
xo,yo    top left of the box array, from the origin
xi,yi      x-increment and y-increment of the box array

Tuesday 15 March 2011

Evaluate scanner profile with Argyll "robust" mean

PM5: scanner profile generated with PM5
MP: scanner profile generated with MP
Argyll: scanner profile generated with Argyllcms 1.3.2

Kodak Q60 scanned image (ncm) was assigned profile with CS4, then converted to aRGB color space. RGB values (robust mean algorithm) were sampled with Argyll's command: scanin -o raw.tif it8_Q60.cht. val file was read with PatchTool and compared with reference set.




                              ΔE2000
                   average  90%     95%     max

PM5                 1.68    2.30    2.47    3.00
MP                  0.42    0.75    0.88    1.82
Argyll              0.17    0.35    0.46    1.60 (option -qu -ax)


PM5(tweaked 98a)    0.96    1.55    2.00    2.73
MP (tweaked white)  0.40    0.71    0.90    2.17
  

Monday 14 March 2011

.cht for Kodak Q60 IT8 target

Command: scanin  -o -dinp scanner.tif  it8.cht
.val file
There are total of 264 patches in Kodak Q60 target. With the standard reference template it8.cht and command scanin -o -dinp scanner.tif it8.cht, rgb values for all the 288 patches would be included in the generated .val file.

The 24 redundant patches can be put away from the generated .val list by modifying the .cht file as follows.
a) Number of boxes to be changed to 266.
b) Split Y into 2 lines as shown below.
     where 231.625=(25.625x8)+26.625
c)  For last row (GS00 thr' GS23), shift texts to right by 2 units.

File name: it8_Q60.cht
# Kodak Q60 it8 264 color patches

BOXES 266
F _ _ 1 1 616.0 1.5 615.5 358 1 358.5
D ALL ALL _ _ 615 409 1 1 0 0
D MARK MARK _ _ 14 14 1 1 0 0
Y 01 19 A H 25.625 25.625 26.625 26.625 25.625 25.625
Y 01 22 I L 25.625 25.625 26.625 231.625 25.625 25.625
X GS00 GS23 _ _ 25.625 51.25 2.0 358.75 25.625 0.0

BOX_SHRINK 3.5

REF_ROTATION -0.002006

XLIST 32
1.799625 1.000000 0.312500
27.064987 0.874039 0.750000
......

diag.tif output with command:  scanin  -o -dinp scanner.tif  it8_Q60.cht

 Note:
266 boxes = 264 sample boxes + 2 diagnostic boxes
[ .cht format ]
 

Sunday 13 March 2011

Links - profiling matters

How to increase accuracy of the profile when faced with out-of-gamut colors?

Is it possible to profile a printer using a scanner?

Adding White Point to Camera matrix profile

Imaginary Primaries

CMP Digital Target 3
CMP Digital Target 3 chart recognition file

.cht Format
 Tips by Graeme Gill [link]
Quote:{ it8.cht was created by scanning and running scanin -g, then hand editing, while ColorCheckerDC.cht was created completely by hand. You need to be careful of the syntax, since the code is quite simple, and therefore not very forgiving. The usual thing is to try the .cht file out on a real scan while generating the recognition diagnostics, to see how well/not well it is working.

Another approach that may work for some charts, is to create a print test chart that imitates the chart you want to recognize (ie. same layout, relative size & spacing of patches, similar test colors), and then to use printtarg -r -S to generate a .cht file that is setup for that chart. This is only going to be worthwhile if one of the printtarg instrument output formats can be made to match the chart though.}

Hutchcolor target

Saturday 12 March 2011

Extracting RGB values from tiff file with Argyll

[Link to scanin]

.val file
8-bit RGB patch values can be extracted from tiff file using the function scanin with option -o.  The extracted RGB data in .val file is of the standard 8-bit RGB representation.

The typical command line to carry out such function and partial listing of the .val file are as follows.

    scanin  -o  input.tif  it8.cht 
...
A01 42.818 29.194 32.925
A02 50.670 25.994 30.010
A03 58.323 23.304 28.780
...

.ct3 file
In .ct3, the 8-bit RGB values have been normalized with a factor of  (100/255)

SAMPLE_ID XYZ_X XYZ_Y XYZ_Z RGB_R RGB_G RGB_B STDEV_R STDEV_G STDEV_B
A01 3.7800 3.0600 2.6900 16.791 11.449 12.912 0.41150 0.40085 0.43268
A02 4.5900 3.0500 2.2900 19.871 10.194 11.768 0.39215 0.38156 0.41973
A03 5.5000 3.1500 2.0500 22.872 9.1387 11.286 0.37277 0.36667 0.40311
...

Hence, to revert back to standard  8-bit rgb values is by multiplying a factor of (255/100).
For instance, for patch A01,
       R = 16.791 x (255/100) = 42.817
       G = 11.449 x (255/100) = 29.194
       B = 12.912 x (255/100) = 32.925


Averaging of Pixel values
RGB values are computed with scanin by averaging of the pixel values within a sample square, using a "robust" mean in that pixel values that are too far from the average ("outlier" pixel values) are discarded. This is done in an attempt to filter off values that are due to scanning artifacts such as dust, scratches etc. Option -m flag forces scanin to return the true mean values for the sample squares that includes all the pixel values.

Handling White Point with Argyllcms

Reference Links: [Link1]

Scaling a White Point
White point depends on input device. If the  XYZ value for the White Patch can be measured, then the equivalent scale factor can be computed with 100/White_Y.

White Point may sometimes be determined incorrectly
Problem arises when the target white point is not white but green! In that case colprof may determine the white point incorrectly as true white patch has lower Y than green patch.

CS5 Ideal settings for managing scanned data

Reference Links:  [Link 1]

1) In CS5, choose Edit > Color Settings.
2) Change RGB working space to preferred working space, sRGB or aRGB or ProPhoto.
3) Click on the More Options button to expand the dialog box.
4) Always select Adobe (ACE) as the Conversion engine. see note (a)
5) Change the Intent setting to Absolute Colorimetric.  see note (b)

Notes:
(a) Microsoft ICM does not handle the conversion correctly when Absolute colorimetric rendering was selected.
(b) So that absolute (intent) Lab values are displayed when the related profile is assigned. With Absolute Colorimetric, colors would be matched exactly with no adjustment made for white point or black point that would alter the image’s brightness.

Thursday 10 March 2011

Optimising scanner profile generated with Argyll colprof.exe

ArgyIIcms 1.3.2
Assigned with the designated icc profile and converted to aRGB all in CS4.
RGB values were extracted with PM5.
ΔE was computed with PatchTool by comparing with the reference data.

Command:  colprof -v -qh -ax -kx scanner
where  -v            verbose
          -qh           quality high
          -ax           XYZ clut
          -kx           black generation with maximum K  *** see note
           scanner   input: scanner.it3 / output: scanner.icm

ΔE report:  max= 0.88 avg= 0.08
If quality is set to ultra (-qu),  max= 0.84 avg= 0.06

About colprof with option -ax
This creates cLUT profile using PCS of XYZ data better which offers better  accuracy for additive type devices (displays, scanners, cameras etc.) and it avoids clipping of values above the white point that can occur in L*a*b* based cLUT input profiles.

About colprof with option -s src.icc
+++ Does not seem to work

                           ΔE2000
                   average  90%     95%     max

Argyll (default)    1.06    1.93    2.32    5.63   ( -qm )
Argyll ( -qh   )    0.42    0.69    0.87    1.78  high quality
Argyll ( -qu   )    0.42    0.67    0.93    1.88  ultra quality



L values for White point & Black point
                
                          WP     BP
GS00/GS23 (reference)   92.41   2.98  (L values from reference) set

 -ax -kz                92.42   3.03
 -ax -kr                92.42   3.03
 -ax -kh                92.42   3.03
 -ax -kx                92.42   3.03

 -ag -kz                92.45   6.48
 -ag -kr                92.45   6.48
 -ag -kh                92.45   6.48
 -ag -kx                92.45   6.48

 -as -kz                92.19   4.18
 -as -kr                92.19   4.18
 -as -kh                92.19   4.18
 -as -kx                92.19   4.18

note: option -k only affects profile for output device.
[link]

Wednesday 9 March 2011

Performance of Argyll's scanner profile

Argyll 1.3.2
Module: scanin

                           ΔE2000
                   average   90%      95%      max

Argyll (default)    1.06     1.93     2.32     5.63
MP                  1.69     2.21     2.31     2.70     
PM5                 1.99     2.63     2.79     3.23 
   

MP tweaked          0.40     0.69     0.88     1.84

PM5 tweaked         1.21     1.78     2.26     3.08 




Comparing  RGB raw values of Tiff file (Non-Color-Managed)
The RGB values with Argyll and that with Imatest are similar. Imatest uses ICCTrans, the Matlab interface to the LittleCMS color management system. Their values are also closely resemblance to that readout with an eyedropper of size of 11x11 in CS4.


Comparing the rgb value (ncm) for patch L19
             RGB_R   RGB_G   RGB_B
Argyll       20.408  26.135  78.895
PM5          20.990  27.030  80.100
Imatest      20.740  26.250  78.820

Comparing result with reference data & respective generated profile
Scanned images were assigned with the respective profile and converted to aRGB color space. RGB values were extracted with PM5 and compared with the reference patch using PatchTool.
  
                  ΔE2000 for patch L19
Argyll                 5.63         
PM5                    1.53
MP                     0.50


Warning message while running scanin.exe
"wrong data type 7 for "RichTIFFIPTC"; tag ignored"
This warning is issued by libTIFF, this is due to a data type is defined incorrectly. This bug should not affect the overall result.
Link1  Link2

Monday 7 March 2011

Create TIFF test images with argyllcms's timage.exe

Link to argyll's timage

1) timage -x -s test1.tif

test1.tif
2) timage -x -t test2.tif
test2.tif

3) timage -p5 test3.tif

test3.tif


Sunday 6 March 2011

CS5 Color Space Conversion Engines

CS5 ver 12.0.3
Assigned with Monaco scanner profile
Converted to aRGB
Output with Tiff 
Extraxted rgb values 
Compared with reference data using PatchTool


                           ΔE2000
               average   90%      95%      max
Adobe (ACE)
absolute        0.40     0.69     0.88     1.84    
relative        0.40     0.69     0.88     1.84 
perceptual      1.99     2.54     2.61     3.10 
   

Microsoft (ICM)
absolute        6.47    10.85    11.59    13.78    
relative        0.44     0.74     0.90     2.00

perceptual      1.82     2.33     2.42     2.86

    



converted with Adobe engine: Absolute/Relative rendering intent
 

converted with Adobe engine: Perceptual rendering intent


converted with ICM engine: Absolute rendering intent
 

converted with ICM engine: Relative rendering intent
 

converted with ICM engine: Perceptual rendering intent


Saturday 5 March 2011

Optimizing Monaco Scanner Profiler

Scanner: Epson V500
Mode: Reflective scanning with Epson Scan utility


Format of Reference data
For the modified reference set to be read by MP successfully,  the followings must be observed.
a) The format name SAMPLE_ID must not be changed.
b) The patch names under #ID must be retained.
c)  MP only reads the PCS data  in Lab.


Tweaking the White and Black points in the reference set

1) Duplicate the reference file and use the copied file as the working copy.
2) Use note editor to change SAMPLE_ID to SAMPLE_NAME, so that PatchTool can read the Sample Name correctly.
3) Read the modified file with PatchTool.  Select the required Data fields as shown and re-output the reference data.
4) Open the output file
    a) Change SAMPLE_NAME back to SAMPLE_ID.
    b) Modify L value for Dmin from 92.407 to 92.207  (reduced L by 0.2)
    c) Modify L value for Dmax from 2.981 to 2.781     (reduced L by 0.2)

5) Generate the scanner profile with the modified reference set.

Comparison of Result with and without WP and BP tweaking
. Assigned profile in CS4 and converted data to ProPhoto color space
. RGB data were extracted with PM5 and compared to original reference data with PatchTool.
                           ΔE2000
               average   90%      95%      max
Profile
Standard MP     1.69     2.21     2.31     2.70     (ver 4.8)
standard PM5    1.99     2.63     2.79     3.23     (ver 5.0.10)
Epson generic   2.15     3.39     3.93     5.77     

Tweaked MP      0.42     0.72     0.86     2.26    



Evaluated with Imatest