View Bug Details

IDProjectCategoryView StatusLast Update
0000514DCP-o-maticBugspublic2016-05-31 23:55
Reportercarl Assigned Tocarl  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.x 
Target Version1.79.0 
Summary0000514: Various errors and omissions in colour transformations
Description

When calculating a DCP from a BT.709 video there is this chain of color
transformations:

    1          2       3       4

Y'CbCr --> R'G'B' --> RGB --> XYZ --> X'Y'Z'

The first transform uses the inverse of the matrix given in BT.709. It's so
automatic that it's hardly discussed.

The second transform is the much-discussed linearization. I believe it is
critical that this tranform be the same as was used by the grader of the
video. (Otherwise compensations can be made to the video before it goes
DCP-o-matic.)

The third transform is based on both the BT.709 primaries' chromaticities
and the BT.709 white point: CIE D65.

The fourth transform is just a gamma 1/2.6 step and a normalization
constant.

The final result is DCI coded color which should project exactly the same as
the grader saw the video.
This means the DCP will be using a CIE D65 white point. The DCP coding has
just enough headroom to allow this. Z' nearly tops out.
That's OK, but it might be desirable to make a DCP with a different white
point, especially the Xenon white point recommended (but not specified) by
DCI/SMPTE: x=0.3140, y=0.3510.
Such a white point transform is best done after the third transform, because
it should not only shift the white point but also the primaries. The
attached chromaticity diagram <<bt709_bradforded.png>> shows the shifts.
(CIE 1976 chromaticity diagram is better than CIE 1931 for appraising color
gamut.)

So I suggest inserting a transform between the third and the fourth.

       1          2       3       3½      4

Y'CbCr --> R'G'B' --> RGB --> XYZ --> XYZ --> X'Y'Z'

Transform 3½ consists of multiplication by a Bradford matrix. For example,
transforming CIE D65 to SMPTE Xenon requires this matrix:

0.976563  -0.015441  -0.016649
-0.025692  1.028527  -0.003774
-0.005697  0.011063  0.871383

I believe DCP-o-matic should allow user-entry of the matrix used in step 3½,
with default to:

1  0  0
0  1  0
0  0  1

Better yet DCP-o-matic could allow user-entry of the chromaticity of the
desired white-point -- it's easy enough to code the computation of the
Bradford matrix -- with default to CIE D65.


Attached little spreadsheet does the calculation.
Enter first white point in upper magenta boxes.
Enter second white point in the lower magenta boxes.
Bradford matrix is found in green.

Matrix M is taken from Süsstrunk, et al., Chromatic adaptation performance
of different RGB sensors, IS&T/SPIE Electronic Imaging, SPIE Vol. 4300
(2001). Everything else is calculated.
The Excel sheet can be used to verify your coded calculation.

If it's too awful to pull formulas out the Excel sheet I can write it out in
decent mathematical language.

I don't know what you mean by "source files". The Bradford matrix transform
can only be applied at the XYZ stage, just before the final X'Y'Z' stage.

The person making the DCP will likely consider two options: leave the white
point as it was for the source video, e.g., D65 for BT.709; or convert it to
DCI/SMPTE Xenon x=0.3140, y=0.3510. But it would be nice if the user could
choose any white-point he wishes. White point x=0.3333, y=0.3333 is the
most efficient, X'Y'Z' code-wise, and it is the natural white point for DCP.
The Xenon white point is just conventional, based on old movie projectors.

TagsNo tags attached.
Branch
Estimated weeks required
Estimated work required

Relationships

related to 0000499 confirmed Colour transformations are slightly off 

Activities

carl

2015-03-05 18:37

administrator  

bradford transform.xlsx (12,300 bytes)

carl

2015-03-05 18:38

administrator  

bt709_bradforded.png (61,470 bytes)   
bt709_bradforded.png (61,470 bytes)   

carl

2015-03-05 18:39

administrator  

calculate bradford.docx (13,299 bytes)

carl

2015-04-22 16:01

administrator   ~0000551

I believe this is now all implemented in master and 2.0.

Bug History

Date Modified Username Field Change
2015-03-05 18:37 carl New Bug
2015-03-05 18:37 carl File Added: bradford transform.xlsx
2015-03-05 18:37 carl Relationship added related to 0000499
2015-03-05 18:38 carl File Added: bt709_bradforded.png
2015-03-05 18:39 carl File Added: calculate bradford.docx
2015-03-05 20:13 carl Assigned To => carl
2015-03-05 20:13 carl Status new => acknowledged
2015-04-22 16:01 carl Note Added: 0000551
2015-04-22 16:01 carl Status acknowledged => resolved
2015-04-22 16:01 carl Resolution open => fixed
2016-05-31 23:55 carl Status resolved => closed