zimg icon indicating copy to clipboard operation
zimg copied to clipboard

Incorrect conversion of transfer_characteristics from sRGB to Rec.709

Open hym3242 opened this issue 5 months ago • 7 comments

This problem is similar to #61.

The sRGB standard states that the reference display is assumed to have pure 2.2 gamma (pure power law). But the current implementation of sRGB->bt709 (transfer_characteristics) seems to use sRGB piecewise curve as EOTF, then applies BT1886's EOTF^(-1) which is pure 2.4 gamma. What should be done is to apply Lc=V^2.2 then apply V=Lc^(1/2.4) to match the two reference displays. What zimg is doing is assuming that the sRGB material is graded on a monitor with a compound function transfer curve. But from this video most people in industry assume a monitor to have pure 2.2 gamma when it is said to be sRGB.

When conversion is done in 8bit depth, this also causes a problem of the inverse of crushed shadows -- black level is too high and no more true black can be achieved after the conversion.

I would like to apologize if I turn out to be wrong, in which case please kindly point out my mistake!

Edit: @sekrit-twc does not seem to be active though, so this issue will act as a reminder for any color-sensitive pipeline using ffmpeg, which includes large video hosting sites. Do your conversion/LUT locally in Resolve/Baselight etc, do not let YouTube &c do it.

hym3242 avatar Aug 31 '24 20:08 hym3242