Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ICC Profile in Color Managment

13 views
Skip to first unread message

Bo Schwarzstein

unread,
Mar 11, 2009, 4:23:49 AM3/11/09
to
Hello folks, would you like to explain what's the [rgb]XYZ and [rgb]
TRC used in color management system such as in Photoshop ?

For example, if I want to transform a picutre from Wide Gamut RGB to
sRGB for preview, I should do like this :

Transform data from WG RGB to PCS2 by multiply the pixels data with
WGRGB's [xyz]TRC LUT, multiply with the WGRGB's [rgb]XYZ matrix. Then
multiply the pixel in PCS2 space with sRGB's [rgb]XYZ matrix, scale
with the [xyz]TRC^-1 LUT, that's okay.

Am I right ? Thanks !

Gernot Hoffmann

unread,
Mar 11, 2009, 4:52:55 AM3/11/09
to

Bo Schwarzstein schrieb:


It's almost correct. Esssentially, the Chromatic Adaptation
Transform (CAT) is missing.

For one byte per channel
Index s for sRGB / Whitepoint D65
Index w for WideGamutRGB / Whitepoint D50
From Rs' to Rw' (gamma-encoded):

Divide each channel of Rs' by 255
Apply TRCs to Rs' for Rs
Xs = Cxrs*Rs
Xw = B*Xs (CAT by linearized Bradford, matrix B)
Rw = Crxw*Xw = Cxrw^-1*Xw
Apply TRCw^-1 to Rw for Rw'
Multiply each channel of Rw' by 255 and round

The matrices and TRCs can be found here:
http://www.fho-emden.de/~hoffmann/cielab03022003.pdf

Your question concerns a workflow in opposite direction.
Just invert the algorithm. Then you'll need B^-1 which is
available in the same doc.

Bradford CAT is used in Photoshop.
Other CATs are possible.

Best regards --Gernot Hoffmann

Bo Schwarzstein

unread,
Mar 11, 2009, 6:18:11 AM3/11/09
to

Hello Prof. Hoffmann

And would like to tell me more about when the HDR illumination
involved into color management system ?

I think when the HDR image generated by multi-exposed DSLR captured
image,
firstly, we transform the color back into linear light system as in
real world,
then, scale the all color with the scene-reference white color,
finally we can use this image to do a HDR illumination in making a CG
content.

The XYZ (not xyZ) is a linear-light system ? I think the device-
dependent RGB system should be a non-linear system for compensation.

Thanks for your help, your document is really very klar and valuable.

Gernot Hoffmann

unread,
Mar 11, 2009, 8:11:37 AM3/11/09
to

Bo Schwarzstein schrieb:

You're welcome.

Hopefully someone else can answer your questions about HDR.
So far I'm not familiar with.

Meanwhile I'm having some doubts whether the Chromatic Adaptation
Transform is really necessary.
For the conversion sRGB to CIELab it is, because it's assumed that
the observer is adapted to WP D65 at his monitor and to WP D50 for
viewing prints.

If we assume no special adaptation at all, then sRGB to WideGamutRGB
(wRGB) and vice versa can be considered as a coordinate transformation
without any human interaction (no CAT).
If we assume that the observer of sRGB is adapted to WP D65 and the
observer of wRGB to WP D50, then one would need a CAT.

Best regards --Gernot Hoffmann

Bo Schwarzstein

unread,
Mar 12, 2009, 5:48:12 AM3/12/09
to

If the white point (even black point) of color space is different
( sRGB uses D65 and PCS2 uses D50 ), I think we should apply CAT, I
also think the CAT is a "re-white balanced" operation.

Gernot Hoffmann

unread,
Mar 12, 2009, 8:19:06 AM3/12/09
to
> If the white point (even black point) of color space is different
> ( sRGB uses D65 and PCS2 uses D50 ), I think we should apply CAT, I
> also think the CAT is a "re-white balanced" operation.

Sorry, I forgot, that this is handled by rendering intents.

One has to start with a definition of the scenario:
A scene is illuminated by D50, some objects are neutral
(flat reflectance spectrum, or wavy spectrum which delivers
nevertheless reflected light with chromaticity coordinates
of D50, a case of metamerism).
The tristimulus values of scene colors are stored as wRGB
(WideGamutRGB WP D50).
The image of the scene should be shown on a monitor which
is calibrated for sRGB (WP D65 and primaries that of sRGB).
The observer is adapted to the monitor (using considerably
large D65-gray menue areas).

Case 1: Rendering intent Absolut Colorimetric
The wRGB-data are converted into sRGB by the mentioned
(inverted) algorithm, but the matrix B^-1 is an identity matrix
(the multiplication is obsolete).
Scene white/gray appears yellowish (if the observer at the
monitor is still adaptedto D65).
Scene colors are reproduced measurably correct.

Case 2: Rendering intent Relative Colorimetric
The wRGB-data are converted into sRGB by one of the known
CAT, for instance Bradford. Scene white/gray is mapped to
sRGB white/gray. Scene colors are reproduced visually
correct. Neutral objects appear neutral.

The situation is further explained here, mainly for the case
of mapping sRGB D65 data to CIELab D50 data:
http://www.fho-emden.de/~hoffmann/cmsicc08102003.pdf

Best regards --Gernot Hoffmann

Bo Schwarzstein

unread,
Mar 12, 2009, 10:06:18 PM3/12/09
to

Hello Prof. Hoffmann

Thanks for your valuable help, I will have a look at your paper.

Miles Bader

unread,
Mar 13, 2009, 5:29:32 AM3/13/09
to
Gernot Hoffmann <hoff...@fho-emden.de> writes:
>> If the white point (even black point) of color space is different
>> ( sRGB uses D65 and PCS2 uses D50 ), I think we should apply CAT, I
>> also think the CAT is a "re-white balanced" operation.
>
> Sorry, I forgot, that this is handled by rendering intents.
>
> One has to start with a definition of the scenario:
...

Thanks for an excellent and understandable description!

-Miles

--
Dawn, n. When men of reason go to bed.

ddon...@gmail.com

unread,
Mar 24, 2009, 4:30:40 PM3/24/09
to
Hi, I'm new to color management and trying to learn about it. I have
some books on this topic like Colour Engineering (Green, McDonald),
Digital Color Imaging (Sharma), Gamut Mapping Algorithms (Morovic), as
well as ICC profile v4.2 specification, but there is a missing link
which is not explained in none of those books, and that is how to
populate profile LUTs. I wrote my own VB.NET profile classes, but
can't do anything with it because, for example, I don't understand the
purpose of 1D-LUTs in 'gamt' tag, how to populate its 3D-LUT using
some gamut descriptor, and a lot of other things... Are there any
publications explaining this specifically for ICC profiles and where
can I find them?
Thank You in Advance!

Graeme Gill

unread,
Mar 25, 2009, 2:24:14 AM3/25/09
to
ddon...@gmail.com wrote:
> well as ICC profile v4.2 specification, but there is a missing link
> which is not explained in none of those books, and that is how to
> populate profile LUTs. I wrote my own VB.NET profile classes, but

That's because it's up to you to choose how to do it, if you want
to go down this path. To do it comprehensively for a wide range of
devices is non-trivial.

Assuming you are interested in device profiles (since you
haven't specified exactly what you're interested in),
the ICC profile V4.2 spec. explains how each model transforms
from one colorspace to another using ICC mechanisms. You have
to think about how you:

Measure the behavior of the device.

Make a model that maps to the ICC provided mechanisms
reproduce the behavior of the device.

Typically it's not practical to measure a device at more
than a few thousand color combinations, so the process
usually involves interpolation and/or parameter fitting
of the model to the measured response points.

ICC device profiles must also provide a way of mapping
the other way, ie. from PCS to device space. In the case
of an invertible model (ie. matrix type), nothing more
needs to be done. In the case of other models (ie CLUT),
then you also need to think about how to invert your
forward model or model the inverse device behavior. For
devices with more than 3 colorants, thing brings in the
issue of color separation (ie. black generation), and
in the case of perceptual and saturation intents, this
brings in the issue of gamut mapping.

Graeme Gill.

ddon...@gmail.com

unread,
Mar 25, 2009, 4:22:14 AM3/25/09
to
Thank You for fast reply! I also read pieces of Your Argyll source
code, it's quite a job!
I did understand the concept of making a model (linear regression,
local regression, polynimials, splines) for a limited data set, and
predicting the unexamined values using a model. Matlab provides tools
for exporting its functions in a COM for .NET, so mathematics is not a
problem.
The thing that's confusing me, and I think isn't clearly explained in
Spec. v4.2 is the distinction between LUTs for individual rendering
intents, and a 'gamt' LUT. If I understood well, gamut mapping takes
place in a CMM when converting image data from one device to another
(eg. scanner RGB, via PCS, to RGB printer RGB), using their 'gamt'
tags. However, different rendering intents LUTs are created for an
individual device, universally for conversion from (or to) any other
device. And they have something to do with how mapping will be
performed, without prior knowledge of the other device's gamut. And
especially confusing, 1D I/O LUTs in 'gamt' tag.

Gernot Hoffmann

unread,
Mar 25, 2009, 9:11:30 AM3/25/09
to

ddonev...@gmail.com schrieb:

Years ago I had tried to find gamut boundaries by interpreting
the gamut tag:
http://www.fho-emden.de/~hoffmann/cmykgamut23042003.pdf

Sometimes it worked, sometimes it failed (for the inkjet).
An Adobe engineer told me, that this tag is not the least reliable.

Recently I had built gamut boundaries for CMYK profiles by
Morovic's Segment Maximum Method, here in chapter 9:
http://www.fho-emden.de/~hoffmann/labproof15092008.pdf
(huge doc, 3 Mbytes)

Once the boundary is found, slices can be calculated by inter-
polation, as shown in the 2D graphics.
I'm using AtoB1, which is valid for the rendering intents Media
Relative Colorimetric and Absolute Colorimetric.

I'm not a profile programmer. I'm more interested in clean graphics
for illustrations.
Please establish in Acrobat 72dpi instead of the default 96dpi
(explanation in the second doc). Raster images are THEN pixel-
synchronized for zoom 100%, 200% and so on.

The gamut of a device doesn't depend on the rendering intent.
I would expect that AtoB1 and AtoB0 contain the same information,
but perhaps stored somewhat different, concerning the mapping of
the white point and the black point. Would also like to know more
about.
ProfileMaker > ProfileEditor > GamutView shows just one volume
for each profile.

Best regards --Gernot Hoffmann

ddon...@gmail.com

unread,
Mar 25, 2009, 9:50:15 AM3/25/09
to
Thank You for the explanations and materials!
But I'm still missing parts of the process. I print the chart, measure
it, and obtain characterization data. It contains a limited set of
inputs to a device, and their corresponding outputs. Then, for the
purpose of CALIBRATION, I find values that linearize the device, and
put them in 1D tags. Then, using my data set, I build a model, and
using that model predict values that were not examined by the chart.
In this step, I expect something more has to be done with the data
before putting them in 3D LUTs, because there are 4 different LUTs.
With the same data set, I build a gamut descriptor. When I have a
gamut descriptor, what do I put in 1D LUTs and why? They are used for
calibration when filling redering intents tags, what's their purpose
here? And what range do then 3D luts represent (Lab
0,0,0.....100,128,128 ?, what do the indexes of a 3D LUT mean)?

Gerhard Fuernkranz

unread,
Mar 25, 2009, 5:34:58 PM3/25/09
to
ddon...@gmail.com wrote:
> ... what do I put in 1D LUTs and why? ...

For instance, a LUT "lut16Type" in an ICC profile defines the following
transformation sequence:

(matrix) ⇒ (1d input tables) ⇒ (multidimensional lookup table - CLUT) ⇒
(1d output tables)

Though this transformation is defined as a 4-step procedure, only the
overall result (after applying all four steps) counts. The intermediate
results (e.g. after applying the 1d input tables) don't have a
particular meaning.

So it is up to you, how you split the device model estimated from the
measurements into these four parts. For instance, you are indeed free to
setup the matrix and all 1D LUTs with identity transformations and put
the whole device model into the CLUT. However - depending on the
individual device characteristics - this may result in an unsatisfactory
interpolation accuracy in some regions of the color space. In this case
you may want to find (non-identity) input and output curves which give
you a better overall interpolation accuracy [it's eventually a
mathematical issue to find optimal curves fulfilling this property].

Calibration/linearization is not done by the profile, but outside, and
the profile eventually characterizes the behavior of the linearized
device [as it behaves with the calibration data loaded into the device
(or into the driver or RIP, etc.)].

[A special case are display profiles which may contain a (non-standard)
VCGT tag storing calibration data to be loaded into the graphics card.
This tag is however not used by a CMM when it applies the profile, but
it's only used by calibration loader programs, which run e.g. at system
startup in order to load the VCGT into the graphics card.]

Regards,
Gerhard

Graeme Gill

unread,
Mar 26, 2009, 2:59:30 AM3/26/09
to
ddon...@gmail.com wrote:

> The thing that's confusing me, and I think isn't clearly explained in
> Spec. v4.2 is the distinction between LUTs for individual rendering
> intents, and a 'gamt' LUT. If I understood well, gamut mapping takes
> place in a CMM when converting image data from one device to another
> (eg. scanner RGB, via PCS, to RGB printer RGB), using their 'gamt'
> tags.

Actually, the 'gamt' tag is rarely used, since it most cases
it is highly inaccurate. It's usually more reliable to compute
the gamut from the colorimetric A2B table.

> However, different rendering intents LUTs are created for an
> individual device, universally for conversion from (or to) any other
> device. And they have something to do with how mapping will be
> performed, without prior knowledge of the other device's gamut. And
> especially confusing, 1D I/O LUTs in 'gamt' tag.

The answer is that a passive CMM cannot do real gamut mapping,
an inherent flaw in the ICC model of things. ICC V4 introduces
the concept of a reference medium (ie. reference PCS gamut)
that partially overcomes this flaw, but the bottom line
is that a full range of gamut mappings can only be
achieved using an active CMM that is aware of the source
and destination gamuts.

The input 1D LUTs in the 'gamt' tag perform the same function as
the B2A table, they allow a 1D transformation of the PCS channels.
The output 1D lut is typically used to threshold an internal
implementation value, to provide the desired 'gamt' tag behavior.
For instance, Argyll creates 'gamt' tags by creating a PCS to
1D mapping, the 1D value being a 'distance inside/outside the gamut surface
value. That value is then thresholded at (hopefully) the gamut
surface to give the in/out value required.

Graeme Gill.

Graeme Gill

unread,
Mar 26, 2009, 3:05:00 AM3/26/09
to
ddon...@gmail.com wrote:
> Thank You for the explanations and materials!
> But I'm still missing parts of the process. I print the chart, measure
> it, and obtain characterization data. It contains a limited set of
> inputs to a device, and their corresponding outputs. Then, for the
> purpose of CALIBRATION, I find values that linearize the device, and

Typically profiles are not for calibration, they are for characterization.
Calibration should be done outside the profile, and the profile
should represent the behavior of the calibrated device.

Yes, at the end of the day a calibration could be combined with an
output profile (typically merged into the 1D luts), but
the result is no longer a normal ICC profile.

So for normal ICC profiles, the 1D luts are just a mechanism
that can be used to better model the device behavior.

Graeme Gill.

ddon...@gmail.com

unread,
Mar 26, 2009, 5:32:04 AM3/26/09
to
First, I'd like to thank all of You for helping me with this, it's
much clearer to me now. I know I'm already annoying with questions,
but I'd like to ask one more, and then I'll be quiet :)

> Actually, the 'gamt' tag is rarely used, since it most cases
> it is highly inaccurate. It's usually more reliable to compute
> the gamut from the colorimetric A2B table.

So, if I understood well, in the case of a passive CMM, values
obtained by the model are gamut mapped to a reference medium (using 3
(absolute & relative colorimetric differ only in white point) or 4
different GMAs), chromatic adaptation transform is applied if needed,
and then the values obtained in that way are put in their
corresponding CLUTs?

Thank You,
Davor Donevski

Graeme Gill

unread,
Mar 30, 2009, 7:38:01 AM3/30/09
to
ddon...@gmail.com wrote:

> So, if I understood well, in the case of a passive CMM, values
> obtained by the model are gamut mapped to a reference medium (using 3
> (absolute & relative colorimetric differ only in white point) or 4
> different GMAs), chromatic adaptation transform is applied if needed,
> and then the values obtained in that way are put in their
> corresponding CLUTs?

It's really up to you to decide how to deal with gamut mapping
in the context of the ICC way of doing things. As it's been
describe to me, some profiling packages use "generalized"
gamut mapping, from the whole of the PCS gamut.

My own code does gamut mapping when the use supplies a specific
source gamut, which will either be the actual source colorspace
the profile will be linked with, or one that is representative
of it.

Graeme Gill.

ddon...@gmail.com

unread,
Mar 30, 2009, 10:41:57 AM3/30/09
to
On Mar 30, 1:38 pm, Graeme Gill <inva...@invalid.invalid> wrote:

Ok, it's really harder than I thought because evreything is optional
so it's hard to figure out what is performed during the profile
building, and what is left to the CMM to handle. But I've got the
general idea, which will make a more in-depth study easier. Thanks
again to everyone for hepling me!

ddon...@gmail.com

unread,
Apr 10, 2009, 11:46:24 AM4/10/09
to
Hi,
I've built a simple 3rd-order regression model using RGB-XYZ value
pairs from characterization data. I collected the samples in their
matrices (C and D - usual notation for output and input), and derived
a 3x9 matrix A (R G B R^2 G^2 B^2 R^3 G^3 B^3). But, when using the
model for prediction (populating CLUT), it predicts negative XYZ
values if the input RGB values are very small. As soon as the RGB
values exceed this small treshold, it predicts normal (positive) XYZ
values. Any experiences with this? What to do?
Thanks!

Gernot Hoffmann

unread,
Apr 11, 2009, 4:54:48 AM4/11/09
to

ddonev...@gmail.com schrieb:

Let's consider a simple example, the interpolation of four
points y(x) --> y1, y2, y3, y4 by a cubic parabola
y(x) = a0 + a1*x + a2*x^2 + a3*x^3:
For the case y1>0, y2>0, y3>0, y4>0 the function y(x) can
be negative in some regions.
This is quite common for bicubic image interpolation.
If the resulting values C=R,G,B exceed the range [0,255] they
have to be clipped.
A general solution is offered by B-Splines: the quadrilateral
of the four control points is the bounding quadrilateral for the
curve, which does not necessarily pass through the points
(blurring for images) .

For the actual problem the situation might be similar.
The algorithm doesn't know that X,Y,Z have to be non-negative.

Some time ago we had here a discussion about the question
whether intermediate negative values might be still meaningful.
It seemed they are, in the context of so-called 'adapted primaries'.

Perhaps the situation can be improved by using a linear
regression in the critical region (a quadratic would be even worse).

Best regards --Gernot Hoffmann

ddon...@gmail.com

unread,
Apr 13, 2009, 4:56:10 PM4/13/09
to
Thank You. I will have to try several models to see what they predict.
I am aware that higher-order polynomials tend to "overfit" the data
and add extra bends (local extrema), but I didn't expect negative
values if the training set doesn't contain them. And I have no idea
how to handle them except assigning them a value of zero. I'll just
have to try different models and see what they predict.
Thanks again!

skyf...@gmail.com

unread,
Apr 16, 2009, 5:24:12 AM4/16/09
to

I had experience to predict LCD's XYZ values with higher-order
polynomials regression.
It is suggesting you select order of polynomials according to size of
training dataset.
Small dataset cause "over-fit", but big one would not.

In my experience, 729 color training dataset with 3x20 3rd-order
polynomials has good performance(mean deltaE about 0.5, max deltaE
about 6).
If your dataset is less than 100 color, 3x3 matrix or S-CurveI may be
a good candidate.
A RIT scholarly paper may be a good start for above mentioned model.
(https://ritdml.rit.edu/dspace/handle/1850/4334)
According to my study for LCD model, SHARP's model may be a best one
at present. (https://www.imaging.org/store/epub.cfm?abstrid=8443) It
intact consider the crosstalk of channel, it's performance is mean
deltaE about 0.5 and max deltaE about 1 in my implement.

It is hope helpful to you.

ddon...@gmail.com

unread,
Apr 16, 2009, 9:39:14 AM4/16/09
to
Thank You,
every information is helpful and useful to me. I am a beginner and I'm
just studying this field. The model I metioned above was a model of a
simple desktop ink-jet printer. Prof. Hoffmann gave me a useful
example of a polynomial interpolation with negative regions, and it
got me thinking when it occurs... When the function changes its
direction rapidly. Then I examined the data, plotted it (R=G=B on the
interval [0, 255] on the x-axis, and L* on the y-axis) and found that
the black point (R=G=B = 0) exhibited greater lighthness than the
other dark patches. It was an error in the deposition of black ink
which I couldn't notice on the chart.
Thanks again for every information, it's all useful!
0 new messages