Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate where Bruce Lindbloom's "Von Kries" chromatic adaptation transform matrix is coming from. #121

Closed
KelSolaar opened this issue Sep 8, 2014 · 23 comments

Comments

@KelSolaar
Copy link
Member

The matrix we are using for Von Kries CAT is originating from Bruce Lindbloom website: http://brucelindbloom.com/Eqn_ChromAdapt.html, the issue is that there is no source for it or any of them actually, and I ran into that paper specifying a different Von Kries CAT from Hunt, Pointer and Estevez: http://infoscience.epfl.ch/record/34049/files/SusstrunkFH01.pdf

Bruce Lindbloom:

[[ 0.4002400, 0.7076000, -0.0808100]
 [-0.2263000, 1.1653200,  0.0457000]
 [ 0.0000000, 0.0000000,  0.9182200]]

Hunt, Pointer and Estevez:

[[ 0.3897, 0.6890, -0.0787]
 [-0.2298, 1.1834,  0.0464]
 [ 0.0000, 0.0000,  1.0000]]
@MichaelMauderer
Copy link
Member

I am not 100% sure but I think I already looked into hat at some point and found the Matrix in Fairchild CAM book. Don't have the book at hand right now, but I'll have a look tomorrow.

@KelSolaar
Copy link
Member Author

Ah that's a very good clue, cheers! I have the kindle edition, I will do a search :)

Thanks!

@KelSolaar
Copy link
Member Author

Yeah indeed it's in (9.5 FAIRCHILD’S 1990 MODEL, Equation 9.26):

Hunt– Pointer– Estevez transformation with illuminant D65 normalization is used. [...]

I was actually wondering if the version of the paper was the result of some kind of normalisation, now I don't know at all.

@KelSolaar
Copy link
Member Author

Apparently the matrix from the PDF is coming from Mark Fairchild CAM book 1998 edition, I guess it may have been updated later and normalised? I will actually probably ask him.

@KelSolaar
Copy link
Member Author

Mark kindly replied:

Thomas,

It's my please and good luck with your work. You are right on about the matrices. I didn't double check, but it appears that the first is normalized to give equal LMS (RGB) values for D65 and the second for an equal-energy stimulus. The nice thing is that it doesn't matter which one you use as long as you use the corresponding inverse to get back out of the von Kries CAT.

-Mark

I'm thinking about rolling in the one normalized for the equal-energy stimulus.

@KelSolaar KelSolaar added Minor and removed Critical labels Sep 9, 2014
@KelSolaar
Copy link
Member Author

Actually let's keep the matrix as it is, I will close the issue for now.

@KelSolaar
Copy link
Member Author

Hi @ValZapod,

We are using the correct one, thanks for checking though!

CAT02_CAT = np.array([

Cheers,

Thomas

@KelSolaar
Copy link
Member Author

Well, the quote you gave in #121 (comment) is for CAT02:

The published MCAT02 matrix in Eq. 9.40 is incorrect (it is a version of the HuntPointer-Estevez matrix. The correct MCAT02 matrix is as follows. It is also given correctly in Eq. 16.2

Hence my answer :)

I will look at the Von Kries one.

@KelSolaar
Copy link
Member Author

Note that for IPT, we use the one as given in the model:

IPT_XYZ_TO_LMS_MATRIX = np.array([

So it does not really matter in for any of the models, however, if you want to use chromatic adaptation only with that particular matrix, you are using something whose origin is unclear. I might actually contact Lindbloom directly to know more about it.

@KelSolaar
Copy link
Member Author

The matrix there is the IPT one, it does not explain where the Von Kries from Lindbloom is coming from though.

@KelSolaar
Copy link
Member Author

Good find! The matrix is sourced from here: https://onlinelibrary.wiley.com/doi/abs/10.1002/col.5080180308

@KelSolaar
Copy link
Member Author

Looking at the code it is actually the CIE1994 / Nayatani95 one and we use it directly:

NAYATANI95_XYZ_TO_RGB_MATRIX = CIE1994_XYZ_TO_RGB_MATRIX

CIE1994_XYZ_TO_RGB_MATRIX = VON_KRIES_CAT

Mistery solved, I might have come to the same conclusion 6 years ago but did not remember.

@KelSolaar
Copy link
Member Author

Unfortunately, it is quite a common issue in this domain, usually arises from errors when reproducing values to precision/rounding related error.

KelSolaar added a commit that referenced this issue Mar 21, 2020
@KelSolaar
Copy link
Member Author

No worries and you are welcome, I started to sweat a bit when you mentioned CAT02 earlier though :)

What about IPTPQc2 with reshaping BTW, are you going to do it??

If the model is specifically patented, we probably won't! Note that we have ICtCp which is IPT + PQ: and probably very close (if not the same): https://github.com/colour-science/colour/blob/c8acc31a8507dae1af81d7958490ac3428dc2728/colour/models/rgb/ictcp.py

@KelSolaar
Copy link
Member Author

It is patented, so it is pretty much a no-go for a library like Colour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@KelSolaar @MichaelMauderer and others