VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 36 of 36
  1. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by sanlyn View Post
    Originally Posted by jagabo View Post
    ColorYUV(cont_y=-36, cont_u=100, cont_v=200)
    I'm looking at your contrast settings, though. So it's allowed to push chroma far beyond 16-235, as long as luma stays inside that range?
    I wonder if perhaps you're still confused about how the various ColorYUV parameters work.
    The cont_u and cont_v values are stretching the chroma around its centre point, according to the formula
    out = in + (in-128)*cont/256
    So cont_v=200 doesn't add 200 to V, it increases the V component of the saturation by about 80% (200/256).
    Similarly, cont_u=100 increases the saturation U component by about 40%.
    Of course, this could still push chroma beyond the limit, but here the saturation was low to begin with, so no problem.

    Also, note that adding opt="coring" will limit all output values to 'TV' range (16-235 for luma, 16-240 for chroma), although this does not guarantee that the combined YUV values corrrespond to valid RGB values.

    http://avisynth.org/mediawiki/ColorYUV
    Quote Quote  
  2. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I think the mediawiki description of "cont" is what's confusing. The html states: "cont (contrast) is also multiplier for the value, and it stretches the signal out from the center. That means that if the contrast is set to 0, it preserves the values as they are. When the contrast is 256 all values are multiplied by 2 (twice as bright)." [Italics mine].

    At first that led me to believe that cont extends from the center upward. That led me down the wrong path, I see. It actually stretches in both directions, which is what most RGB filters do when they increase saturation. So negative contrast should bring extremes back again, closer to center.

    The wiki also adds: "Although it is possible, it doesn't make sense to apply this setting to the luma of the signal." Hmm. It might not make sense, but I see scripts doing it all the time and it seems to have the desired effects.

    I have one problem piece of video where little of this behavior seems to apply. But that's another story.
    Last edited by sanlyn; 21st Mar 2014 at 06:09.
    Quote Quote  
  3. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by sanlyn View Post
    At first that led me to believe that cont extends from the center upward. That led me down the wrong path, I see. It actually stretches in both directions, which is what most RGB filters do when they increase saturation. So negative contrast should bring extremes back again, closer to center.
    That's right. A negative cont_u and/or cont_v reduces saturation.

    The wiki also adds: "Although it is possible, it doesn't make sense to apply this setting to the luma of the signal." Hmm. It might not make sense, but I see scripts doing it all the time and it seems to have the desired effects.
    I think they say that because you don't always want to stretch luma about the point Y=128, although you can compensate for that in a way by using off_y as well, as in post #26.

    In fact, 'cont' is redundant in the sense that its effects can always be achieved by a suitable combination of 'gain' and 'off' (set gain=cont and off=cont/2, as can be seen from the formula in post#26, which I have just edited to correct an error I spotted). However, it's more useful for chroma as it corresponds directly to adjusting saturation.
    Last edited by Gavino; 24th Nov 2011 at 07:35. Reason: cont equivalent to gain+off
    Quote Quote  
  4. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    You know, I think I've been working too long with my "problem video" from another thread -- so long, I had to stop and re-learn what jagabo and Gavino are saying here. What you describe is more or less what I've been doing with other captures. I think my "other" video is just a piece of bad mastering (or bad capturing) that makes ColorYUV refuse to respond as advertised (?); not even RGB in After Effects could make it behave. But in this cartoon video, the "usual" way worked for me.
    Last edited by sanlyn; 21st Mar 2014 at 06:10.
    Quote Quote  
  5. Gain and contrast in ColorYUV are essentially the same thing. They both multiply the signal. But gain multiples around a baseline of 0, contrast multiplies around a baseline of 128. Since there can't be any values below 0, gain only increases values. But if video could have values below 0 they would decrease (become more negative).

    So increasing the contrast of of the luma signal results in darks getting darker and lights getting lighter. Increasing the contrast of the chroma signal increases color saturation. Increasing the gain of the luma results in all pixels getting brighter (except 0 which stays at 0). Increasing the gain of the chroma signals results in some weird color shift that I can't really fathom. Basically, positive values push toward purple, negative push toward green.

    WRGB ramps:
    Click image for larger version

Name:	rgb.jpg
Views:	416
Size:	71.7 KB
ID:	9767

    cont_u/v=50:
    Click image for larger version

Name:	pos.jpg
Views:	424
Size:	71.6 KB
ID:	9770

    cont_u/v=-50:
    Click image for larger version

Name:	neg.jpg
Views:	411
Size:	69.8 KB
ID:	9771
    Last edited by jagabo; 24th Nov 2011 at 08:29.
    Quote Quote  
  6. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    Gain and contrast in ColorYUV are essentially the same thing.
    Exactly.
    In fact, each can be replaced by the other with a suitable adjustment to 'off' (see my edit above).
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!