[argyllcms] Re: using targen with an existing profile

Roberto Michelena wrote:
I am not getting from Targen what I expected...

I have a good profile built from a lot of patches. The original
patches are spread regularly in device space (typical chart generated
by Gretag's MeasureTool), so when I plot them in Lab space (the
measurements of course), I can see there's a high concentration around
the black point (more than needed, tightly spaced) and there's an
insufficient concentration around the saturated greens and other
saturated gamut-edge colors.

So I guessed if I used Targen with the "-c" option, feeding it this
existing profile, it would distribute points more evenly accross Lab
space; including less redundancy in dark zone, and tighter sampling of
saturated colors.

I used:

targen -v -d 4 -e 6 -s 21 -f 4096 -l 260 -c existingprofile.icc
newargyll4000target

The surprise came when I fed the resulting CMYK points through the
profile, and then plotted the resulting Lab values in 3D, comparing
against the previous dataset and the existing profile.
The points are sampling a smaller volume! except for the primaries
ramps which I specified, there are no points sampling the borders of
the gamut; all of them are many dE to the inside.
.
.
.
What am I doing wrong?

I don't think you are doing anything wrong, it's just that it's not doing what you were hoping.

There are a couple of "gotchas" :-

   -c doesn't do anything unless you specify a generation algorithm that
   makes use of it, ie  -R -I, or a -A value > 0.0

   The "adaptation to a previous profile" function (-A > 0.0) hasn't been
   developed to the same degree as the default filling algorithm has. The
   default algorithm will do an initial point placement that is optimal
   to within a 2:1 range, and then will use an iterative algorithm (that can be
   quite slow with a lot of points!) to do better than that. What it
   is aiming for is to minimize the distance from the point in the
   device space that is furthest from any sample point, to its
   nearest sample point.

   When you supply a previous profile and use a non-zero value for -A,
   the iterative improvement is turned off. (This is because I haven't
   figured out a way of making it stable.) It's adaptive in the sense of
   locating samples points that minimize the expected errors of the
   resulting profile, based on the existing profile. In practice 100%
   adaptation is rather fragile (doesn't allow for inaccuracy in the
   profile provided), so -A value of 0.5 is a good place to start.
   Whether the result is better or worse than the default algorithm is
   unknown - I was hoping to get the iterative improvement working before
   attempted to characterize it.

    [This technical paper gives some illustration of the type of algorithm
     I'm talking about:
     
<http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1996/CIS/CIS9613.pdf>
    ]

   If you re-read the goal that the default algorithm is aiming for,
   and have a think about what it means, then you will figure out that
   yes, this results in sample points that aren't at the edges of the
   device value gamut. This is because the edges are are being treated
   the same as all other points, and are no worse off than a point in
   the space equally far from several sample points.

   Now it's quite reasonable to ask whether this is a good thing or not.
   I haven't made up my mind myself, except so far as to force at least
   the primary colorant values to be sampled by making the default
   for -m 2. Certainly my testing didn't indicate that the profiles
   accuracy is at all compromised by the lack of sample points lying
   on the gamut boundary, but I have wondered whether this leaves things
   open to unanticipated problems.

   (I hope this makes some kind of sense!)

Graeme Gill.

Other related posts: