[argyllcms] Re: Custom Illuminant

  • From: <robert@xxxxxxxxxxxxxxxxxx>
  • To: <argyllcms@xxxxxxxxxxxxx>
  • Date: Sat, 12 Jul 2014 09:19:36 +0100

Hi Graeme,

Thanks for your reply. I've made some changes to my description (highlighted
within <<>>) to reflect your corrections with a couple of additions of my

This note only describes the effect of the -g flag in colprof for a
Perceptual mapping only . however it can also be used for a Saturation

The -g flag only affects the Perceptual B2A table (in order for this to be
generated by colprof, the -s flag is also required).

-g uses a gamut file which is produced either from tiffgamut (from a set of
images), or iccgamut (from an icc profile). <<There is no advantage to using
an icc profile gamut with -g as this can be better specified with the -s
flag and no -g flag.>>  I'll refer to this gamut as the Custom Gamut, or CG.

If -g is not used, the Perceptual mapping is from the gamut of the source
profile (which I will call SG) to the gamut of the destination profile
(which I'll call DG).  The B2A0 table, which is responsible for the
Perceptual mapping, effectively 'squeezes' the whole of SG into DG.  All of
the colors that were present in SG will be remapped to new colors in DG,
even if none of the colors in SG were outside of the DG gamut (the effect of
the 'squeeze'). <<Where SG is smaller than DG, the boundary colors are not
shifted. >><<If there are image colors outside SG, they will be clipped to
the DG boundary.>>

<<The -g flag effectively replaces SG by CG (with the white and black points
coming from SG), so that the mapping now effectively 'squeezes' CG into

<<The effect is a Perceptual mapping that is less drastic than the full SG
to DG mapping (which can result in desaturation of the more saturated
colors, for example, because they are shifted to inside the DG gamut if SG
is larger than the image gamut).  The problem with it is that if the image
contains colors that are outside CG, these colors will be clipped to DG, and
so the perceptual relationship will no longer be fully maintained.  For this
reason, profiles using -g should only be used when the image gamut is known
to be inside of CG: this can only be guaranteed if the image is part of the
set of images used in tiffgamut to make CG.  With caution, the profile could
be used for an image that was not used to created CG, IF it is known, within
reason, that its gamut is approximately within CG.>>

The reason for this sort of approach is to attempt to reduce the
desaturation that can be the result of a Perceptual mapping from a large
color space to a smaller one.  (It is also applicable to Saturation

<<If the image gamut is not known to be within CG and we do not wish to
produce a new profile . but we wish to soften the full SG to DG squeeze, an
alternative strategy to using the -g flag is to do a Relative Colorimetric
mapping to an intermediate-sized gamut (for example from ProPhoto to Adobe
RGB), followed by a Perceptual mapping to DG.>>

Am I nearer the mark this time?

As a slight aside, how are profiles which have no source profile specified
usually made, do you know (for example by i1Profiler)?  Must they assume
some intermediate gamut like Beta RGB (smaller than ProPhoto but larger than
AdobeRGB), or is there some alternative algorithm that doesn't require the
source profile?

Many thanks,


Other related posts: