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 !
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
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.
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
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
Hello Prof. Hoffmann
Thanks for your valuable help, I will have a look at your paper.
Thanks for an excellent and understandable description!
-Miles
--
Dawn, n. When men of reason go to bed.
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.
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
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
> 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.
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.
> 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
> 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.
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!
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
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.