VideoHelp Forum


Try DVD Fab Video Downloader and rip Netflix video! Or Try DVD Fab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. I am working on a video that has poor colors. After some fiddling with photoshop I figured it could use a small bump in contrast and a small decrease in brightness. However after trying to use Tweak(0.0, 1.0, -15.0, 1.1) I've noticed that its effect is nowhere near what I am expecting. Contrast particulary doesn't appear to scale the way it does with photoshop. Is there a better option than tweak or a setting I'm overlooking?

    Another good slider that photoshop provides is "color vibrance" but I have no clue how that could translate in AviSynth. Any pointers? Thank you.

    Unfortunately I cannot exactly provide a reference frame from the source due to the nature of the content.
    Quote Quote  
  2. I don't use the program but analyzing this help video:

    https://helpx.adobe.com/photoshop/how-to/adjust-contrast-brightness.html

    Brightness and Contrast mean different things in AviSynth. AviSynth uses video (TV) terminology rather than photographer's terminology. In Tweak Contrast is a gain (Y' = Y*Contrast) and brightness is an offset (Y'=Y+Brightness). Photoshop's Brightness is similarTweak's Contrast. Photoshop's Contrast is a combination of Contrast and Brightness in Tweak. I recommend you just fiddle with the values until you get what you want.

    Other possible issues:

    Photoshop may be working in RGB, whereas Tweak works in YUV. Results will be different in that case.

    You may have YUV/RGB conversion differences: full range vs limited range (effect black and white levels), and rec.601 vs rec.709 (effects colors).

    <edit>
    Oh, also, Tweak limits Y values to standard "limited range" levels by default (16 to 235). Use coring=false to prevent that.
    </edit>
    Last edited by jagabo; 4th Dec 2020 at 12:44.
    Quote Quote  
  3. OK I've managed to make a comparison between Tweak and Photoshop, both with an exagerated bump in contrast, as you can see the results are nowhere near. It's not so much an issue with the scaling as it is an issue with the effect it's having on the picture.

    Image
    [Attachment 56071 - Click to enlarge]


    Unfortunately it's a little painful to fiddle with Tweak, as I have to write the script manually and reload each time in VirtualDub... maybe there's a way to have a GUI showing real time effect of the filter?

    There are no conversions in the script either, but you are correct in the fact that Tweak works in YUV only, so it may be the issue. What then could I use to obtain the desired effect?
    Quote Quote  
  4. Also, Adobe's "contrast" uses the actual center point for the contrast. Tweak's contrast center equivalent is somewhere in the shadows and works entirely differently. It just changes the slope of the curve with a fixed origin point at zero.

    You can use Dither_sigmoid_direct and Dither_sigmoid_inverse from dither tools to adjust increase or decrease contrast similar to Adobe , and also the contrast center (by default 0.5 or center) . The avs version only works with stacked 16bit msb/lsb, not native 16bit or other pixel formats

    If you look at the graph in this post , the s-curve (and inverse s-curve for lowering contrast) , with a center point in the middle by default is how most NLE's work with "contrast" . You can adjust the contrast midpoint
    http://forum.doom9.net/showthread.php?p=1923889#post1923889
    Quote Quote  
  5. Image
    [Attachment 56072 - Click to enlarge]


    dither_sigmoid_direct is having this very weird effect what gives? I'm using 1.28. Full script for reference.

    Code:
    DGSource("D:\Ripping\VOB\STREAM\00000.dgi")
    AssumeTFF()
    QTGMC(preset="fast")
    Dither_sigmoid_direct(cont=6.5)
    EDIT: Sorry it's probably what you're mentioning with pixel format. But can I even convert to the appropriate one?
    Quote Quote  
  6. It uses stacked 16, you can't use it directly on 8bit
    Quote Quote  
  7. It would be something like this for the syntax for stacked16, going back to 8bit

    Code:
    .
    .
    Dither_convert_8_to_16()
    Dither_sigmoid_direct(settings....)
    ditherpost(mode=whatever)
    .
    .
    As jagabo metioned above, the RGB vs. YUV makes it difficult to get it exactly the same. Saturation is also defined differently (vibrance and saturation both in RGB in Adobe have different formulas)


    This is semi-close, the highlights in the skin detail are a bit off

    Code:
    ImageSource("compare.png")
    spline16resize(width/3 , height/3)
    crop(1017,0,0,0,true)
    converttoyv24(matrix="rec709")
    histogram("levels")
    c1=last
    
    ImageSource("compare.png")
    spline16resize(width/3 , height/3)
    crop(0,0,-1017,0,true)
    converttoyv24(matrix="rec709")
    orig=last
    
    orig.greyscale()
    Dither_convert_8_to_16()
    Dither_sigmoid_direct(cont=2.5, thr=0.53, u=2, v=2)
    ditherpost(mode=6)
    y=last
    
    orig.utoy
    Dither_convert_8_to_16()
    Dither_sigmoid_direct(cont=3, thr=0.5)
    ditherpost(mode=6)
    u=last
    
    orig.vtoy
    Dither_convert_8_to_16()
    Dither_sigmoid_direct(cont=3, thr=0.5)
    ditherpost(mode=6)
    v=last
    
    YToUV(u,v)
    MergeLuma(y)
    smoothlevels(0,1,255,0,252, chroma=0)
    
    subtitle("avs")
    histogram("levels")
    c2=last
    
    stackhorizontal(c1,c2)
    Image
    [Attachment 56073 - Click to enlarge]



    Another way you could do it is export a cube LUT from photoshop or image editor ,the apply the LUT in avisynth (using avscube), but this works in RGB too
    Quote Quote  
  8. I see, I can work with that thank you very much for your help.
    Quote Quote  
  9. A simple RGBAdjust(r=1.10, g=1.10, b=1.10, rb=-14, gb=-14, bb=-14) is pretty close. Or Tweak(cont=1.08, bright=-9, sat=1.25, coring=true) in rec.709 YUV.
    Last edited by jagabo; 4th Dec 2020 at 21:31.
    Quote Quote  
  10. Originally Posted by ZetaStax View Post
    Unfortunately it's a little painful to fiddle with Tweak, as I have to write the script manually and reload each time in VirtualDub... maybe there's a way to have a GUI showing real time effect of the filter?
    Open the script in AvsPmod. It provides sliders for changing parameters and you will see the effect immediately in the preview.
    Quote Quote  
  11. You can press F2 within VirtualDub to reload the script. If you are using VirtualDub2's built in script editor (Tools -> Script Editor) you can press F5 when the editor has keyboard focus, or F2 when the main VirtualDub window has keyboard focus.
    Quote Quote  



Similar Threads