Thanks in helping improve my understanding of colprof. "If the device is linearly additive, then (in theory) all one needs to do to model it's 3 dimensional behaviour accuratelyis to convert the channel values into linear light quantities and then transform to XYZ using a 3x3 matrix." So non-linear per channel curve(s) makes the channel(s) linearly additive before a matrix transform? In this case, a linear RGB file (RAW processed with gamma = 1) is a good default input for profiling with options -a g, -a G, -a s, -a S (and -a x which is linear as well): "When using an additive multi-dim model (such as matrix of XYZ cLUT), then the per-channel curves will tend to cause a best fit by converting the device values to linear light. So any gamma added to the native device behaviour will tend to be undone by the profile,particularly for a matrix model." Fair enough, but in ufraw there is a "linearity" parameter which can be used to tune the black level and shadows and generally improves profile fit. Let's call such modifications of the device behaviour "pre-conditioning" the RGB before input to the profile: 1) setting gamma = 2.2 (common for many colourspaces); 2) adjusting exposure to get the white level matching the reference data (reference XYZ converted to a D50 RGB colourspace, I use Wide Gamut RGB); 3) adjusting "linearity" to get the black level matching the reference data. Excuse me for confusing the discussion with an application outside of Argyll CMS! "Typically such systems are not setup to be absolute colorimetric, so there is likelyto be a white point shift, making side by side comparison difficult." Definitely, but it's important that the profile is consistent with camera white balance and perceptual rendering intent. I don't want to have to tune the white balance on every photo to correct slight colour casts resulting from a non-neutral profile. The RAW attraction for me is white balance. Well, it looks like I need to do some more comparative evaluations. I really don't have enough patches for cLUT profiles. Gamma + matrix looks promising.I have also learned that the camera manufacturer's colour is not always best! Stephen. ________________________________ From: Graeme Gill <graeme@xxxxxxxxxxxxx> To: argyllcms@xxxxxxxxxxxxx Sent: Wednesday, 14 December 2011 11:21 PM Subject: [argyllcms] Re: mathematics question - colprof models and cameras Stephen T wrote: > Matrix (-m) I think I understand: it's a 3x3 matrix that converts linear RGB > to (linear) XYZ. > > Now, what is the purpose of the matrix in the "+ matrix" models (-G, -g, -S, > -s) ? Are the > gamma/shaper curves used to "pre-condition" the data before going into a > matrix to XYZ or? Hi, profiles model the behaviour of the device. If the device is linearly additive, then (in theory) all one needs to do to model it's 3 dimensional behaviour accurately is to convert the channel values into linear light quantities and then transform to XYZ using a 3x3 matrix. So the other options choose what sort of non-linear per channel curve to use. A gamma curve has fewer degrees of freedom than a shaper curve, which may be an advantage or disadvantage depending on the number of sample points and the nature of the device per channel non-linearity. A single curve applied to all channels can have certain benefits in some situations, for instance if the device per-channel non-linearity is known to be identical in all channels (reduces degrees of freedom and hence scope for errors). In practice the apparent input devices behaviour may not be additive. This can be due to unevenness in the test image, flare, metameric mismatch of the input devices sensitivities, etc. I'm not really sure what you mean by "pre-conditioning" - profiling is about modelling device behaviour, not about changing the behaviour of anything. Changing a devices behaviour is called calibration, and is best regarded as a separate process. > Look-up tables I also understand. I also know that Lab is a non-linear > colourspace, XYZ is > linear. XYZ is linear light, which can be an advantage if the underlying device behaviour is close to linear. But XYZ is also a highly non-perceptually even space, so the evenly spaced grid of a cLUT can be at a disadvantage in XYZ space. L*a*b* by contrast is closer to perceptually linear, so the grid is closer to being perceptually linearly distributed, so the choice between XYZ and L*a*b* is not clear cut. An additional factor is the per channel curves. On the device side these can be tuned to turn the (possibly non-linear light) values into linear light values, making an XYZ grid cell behaviour more linear. On the PCS side the per-channel curves can be used to encode linear XYZ space to a non-linear light but perceptually more even XYZ space, mitigating some of the disadvantages of the even grid spacing when transforming in the reverse direction. > Now, which model's are suitable for camera profiling (140 patches) and how > should I precondition > the data (in ufraw)? Hard to say as it depends on your exact situation. You really have to try a few different options out and see which best suite your purpose. 140 patches though, is not very many for a cLUT type profile. Again, I'm not sure what you mean by "precondition". > I know that the matrix model is only for linear (gamma = 1) RGB images. > It is not clear whether linear or non-linear (gamma = 0.45 == 2.2) is better > for the other model > options. It seems that errors are a bit lower when I precondition that data, > which doesn't make > sense to me for the "+ matrix" models. When using an additive multi-dim model (such as matrix of XYZ cLUT), then the per-channel curves will tend to cause a best fit by converting the device values to linear light. So any gamma added to the native device behaviour will tend to be undone by the profile, particularly for a matrix model. The curves are not likely to be perfect in this regard though, and errors could be magnified with certain combinations. > So far, it seems that gamma+matrix works fairly well in comparative > evaluations using real word > images (viewed side-by-side on a calibrated and profiled, wide-gamut > monitor). My matrix profile > has a slight colour cast. The XYZ lut had the lowest errors but also seems to > have a slight > cast. You're concatenating two profiles, so you naturally concatenate any errors in the two systems. Typically such systems are not setup to be absolute colorimetric, so there is likely to be a white point shift, making side by side comparison difficult. Graeme Gill.