@@ -34,6 +34,8 @@ function lin_sRGB_to_XYZ(rgb) {
3434 // convert an array of linear-light sRGB values to CIE XYZ
3535 // using sRGB's own white, D65 (no chromatic adaptation)
3636 // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
37+ // also
38+ // https://www.image-engineering.de/library/technotes/958-how-to-convert-between-srgb-and-ciexyz
3739 var M = math . matrix ( [
3840 [ 0.4124564 , 0.3575761 , 0.1804375 ] ,
3941 [ 0.2126729 , 0.7151522 , 0.0721750 ] ,
@@ -54,7 +56,7 @@ function XYZ_to_lin_sRGB(XYZ) {
5456 return math . multiply ( M , XYZ ) . valueOf ( ) ;
5557}
5658
57- // display -p3-related functions
59+ // image -p3-related functions
5860
5961
6062function lin_P3 ( RGB ) {
@@ -168,10 +170,12 @@ function gam_a98rgb(RGB) {
168170
169171function lin_a98rgb_to_XYZ ( rgb ) {
170172 // convert an array of linear-light a98-rgb values to CIE XYZ
171- // using D50 (so no chromatic adaptation needed afterwards)
172173 // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
173- // which has greater numerical precsion than section 4.3.5.3 of
174+ // has greater numerical precsion than section 4.3.5.3 of
174175 // https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
176+ // but the vaues below were calculated from first principles
177+ // from the chromaticity coordinates of R G B W
178+ // see matrixmaker.html
175179 var M = math . matrix ( [
176180 [ 0.5766690429101305 , 0.1855582379065463 , 0.1882286462349947 ] ,
177181 [ 0.29734497525053605 , 0.6273635662554661 , 0.07529145849399788 ] ,
0 commit comments