View Single Post
Old 20th June 2018, 21:14   #4  |  Link
TlatoSMD
Registered User
 
Join Date: Apr 2006
Posts: 74
Okay, I *THINK* I've worked this out. After lots and lots and lots of googling, at last I found so-called "cofficients" for RGB to YCbCr which looked like single gamma values per channel. This is crucial, because most explanations of how to get from RGB to either YUV or YCbCr don't simply give these three gamma values but actually go through all this analogue electronic BS of difference values and color subsampling rather than give simple, specific gamma values.

So, what I found was this table on http://www.ilkeratalay.com/colorspacesfaq.php :

+----------------+---------------+-----------------+----------------+
| Recommendation | Coef. for red | Coef. for Green | Coef. for Blue |
+----------------+---------------+-----------------+----------------+
| Rec 601-1 | 0.2989 | 0.5866 | 0.1145 |
| Rec 709 | 0.2126 | 0.7152 | 0.0722 |
| ITU | 0.2220 | 0.7067 | 0.0713 |
+----------------+---------------+-----------------+----------------+

Understanding that in order to get away from the green and yellow tint that I get from the gamma correction in VLC, I knew I needed more red and blue, but not more green. Since the values for green are the largest for each format, I figured I'd go 1 minues (value). Trying the values for 601, the result was a dark purple image, which couldn't be right because the image has to be brighter, just like when I use global gamma and set it from 10 to 9. So figuring that Y aka green is the "standard" in YUV against which the other two colors are compared, I raised the green gamma from its computed position up to the default 1.00 and added the same number to the other two channel gammas. That looked better, so I rendered the result to HDD and looked at it in VLC plus gamma correction, and found the thing was still much too red, even though the global gamma fix in VLC did still make it a bit greener.

So next I tried the same thing with the values for 709 and ITU. Still too red. Paused to think. I remembered that in analogue YUV, the bandwith for U and V are identical, so I put in the same values for red and blue. The result looked a little better, but still not perfect. Hm. Since Y is least reduced in analogue YUV, why not just leave green alone, so that it will not move down with the other two channels before all three are bumped up again to make green the default 1.00 again?

BINGO! Only adding the 0.07 blue coefficient from ITU to both the blue and red channel gamma does the trick! Now the b/w looks like true b/w in VLC + gamma shift, and the color bits also look fine.
TlatoSMD is offline   Reply With Quote