[FFmpeg-trac] #9167(undetermined:closed): Color changed when an image converting to video

FFmpeg trac at avcodec.org
Tue Mar 30 22:34:05 EEST 2021

#9167: Color changed when an image converting to video
             Reporter:  kvsico       |                    Owner:
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:  invalid
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |

Comment (by pdr0):

 Replying to [comment:6 Balling]:
 > >because the color models do not overlap perfectly
 > They do not overlap perfectly. Of course if you are doing limited vs.
 full range it is obvious. But even if you do full vs full, some YCbCr
 colors will be out-of-gamut for RGB. For example, YCbCr limited BT.709
 values 139, 151, 24 R'G'B' is -21, 182, 181 (which is what is used for
 xvYCC, but that is another topic). The same about full range, of course.
 > You can use calculator here: https://res18h39.netlify.app/color It the
 only one I found that is correct including BT.1886/XYZ and other stuff. Of
 course no way to reshape BT.1886 which is not perfect 2.4 gamma.
 > Now with 4:2:0 you are able to do any color but if you fix one pixel of
 one color the other pixel neer if different color will have to be off-by-
 one or worse.

 Yes, he's using 4:4:4; we are assuming no subsampling, or things like
 lossy differences

 For out of gamut - it does not apply in this situation because you're
 starting with RGB . All out of gamut values have already been eliminated
 by definition. (Assuming the absence of lossy encoding, chroma subsampling
 or other transforms applied)

 All 8bit RGB colors are represented by 8bit YUV ; the problem is there are
 too many values; many YCbCr value map to the same RGB value. Hence the
 errors. 10bit YUV is required for the precision to specify exact 8bit RGB

Ticket URL: <https://trac.ffmpeg.org/ticket/9167#comment:8>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list