[argyllcms] Camera matrix profile, adding ti3 perfect white data set

  • From: Elle Stone <l.elle.stone@xxxxxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Fri, 22 Jan 2010 10:37:43 -0500

Hi members of list,

I had what I think was a neat idea, thought I'd share and see others
might think.

An issue with camera matrix profiles made with v1.0.4 was that the
brightest patch got scaled to L=100, for reasons that make sense for a
printer profile but not so much for a camera profile. The most obvious
practical consequence of this behavior was that when applying the
camera profile, the next step was to open the image in an editing
program and use levels to decrease the overall Lightness of the image
by the amount it would take to get GS00 on the target to go from L=100
to its nominal value of L=92. Without this levels correction, any
points in the image brighter than the rescaled L=92 got clipped upon
conversion to a working space. After rescaling with levels, the image
could be converted to a working space without fear of clipping
highlight values (that weren't already clipped in the raw file of
course).

V1.1.0 has the "scale" option, which seems ideal for eliminating the
need to "rescale" every image to which the camera profile has been
applied. However, I had an idea when working with v1.0.4. The idea was
to add two artificial data sets to the ti3 file before using colprof.
One data set was for perfect white, L=100,a=b=0 and one was for
perfect black, L=0,a=b=0:

GS0B 0.00000 0.00000 0.00000 0.00000 0.00000 0.0000 0.1 0.1 0.1
GS0W 96.420 100.000 82.491 100 100 100 0.5 0.5 0.5

(and of course change the number of data sets from 288 to "NUMBER_OF_SETS 290").

Using V1.1.0, I made three "single gamma + matrix" profiles:

Profile A without scaling (no artificial data sets)
Profile B with scaling (no artificial data sets)
Profile C *without scaling* but with the artificial data sets added to
the ti3 file.

(All three profiles were made with the it8 chart raw file rendered
using dcraw v8.9.8, with "-g 2.2 0". Profiles made with linear gamma
had similar results.)

As you can see from the results below, profile C has the lowest errors
of the three profiles.

A.No scaling, no artificial data sets:

colprof -v -qu -aG -OA-g22-a110-aG.icc -D"A-g22-a110-aG" it8gam22
No of test patches = 288
Creating matrix and curves...
 100%
Find white & black points
Fixup matrix for white point
After white point adjust:
Matrix = 0.912728 0.248761 0.108788
         0.377771 1.139863 -0.200256
         0.015473 -0.199177 1.210368
Done gamma/shaper and matrix creation
Profile done
profile check complete, peak err = 33.155823, avg err = 7.494565

B.Scaling with "-U", no artificial data sets

colprof -v -y -qu -aG -U1.238 -OB-g22-a110-aG-U1238.icc
-D"B-g22-a110-aG-U1238" it8gam22
No of test patches = 288
Creating matrix and curves...
 100%
Find white & black points
Fixup matrix for white point
After white point adjust:
Matrix = 0.737260 0.200938 0.087874
         0.305146 0.920730 -0.161757
         0.012498 -0.160886 0.977680
Done gamma/shaper and matrix creation
[2.235619] 0.883760 0.892150 0.907060 -> 92.031432 0.001043 0.000392
should be 92.038163 -0.693933 -2.124450
profile check complete, peak err = 22.911716, avg err = 3.616571

C.No scaling, with artificial perfect white and black data sets added
to ti3 file:

colprof -v -qu -aG -OC-g22-a110-aG-wb.icc -D"C-g22-a110-aG-wb" it8gam22-wb
No of test patches = 290
Creating matrix and curves...
 100%
Find white & black points
Fixup matrix for white point
After white point adjust:
Matrix = 0.688141 0.183249 0.092810
         0.284660 0.864485 -0.149145
         0.012961 -0.163480 0.975419
Done gamma/shaper and matrix creation
Profile done
profile check complete, peak err = 20.688133, avg err = 2.183257

As you can see from the "peak err" and "avg err" reports, adding the
artificial data sets decreased errors. Also, what might not be so
obvious, is that the profile made with the artificial data sets is
color-balanced, meaning r=g=b=neutral gray. xicclu -g -fif shows the
rgb lines are perfectly aligned. And images to which this profile is
applied don't need rescaling (note that Yr+Yg+Yb=1), meaning L=100
(not L=nominal 92) is 255,255,255 upon conversion to a working space,
with no clipping in the highlights (assuming no pixels were saturated
in the raw file, of course). Meaning the profile itself is
well-behaved and can be used for editing (though being a tad -
understatement - larger than ProPhoto, proceeding with caution would
be a good thing).

Profiles made with v1.0.4 using artificial perfect white and black
patches approach have marginally lower errors, but aren't
color-balanced and well-behaved (close, but not quite).

After using levels to adjust the lightness range, images made with all
three V1.1.0 profiles are visually similar, perhaps even visually
indistinguishable, one from the other.

Can anyone see a problem with this "trick" of adding artificial
perfect black and white data sets to the ti3 file before running
colprof? Or maybe it's something people already do that I didn't know
about?

Thanks, Graeme, for v1.1.0!
Elle Stone

Other related posts: