VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. Hi,

    Does anyone know if there is an existing function for Avisynth that can be used to adjust the brightness of a specific vertical section of the frame?

    One option that came to mind is to try using ColorYUV(off_y = XXX) on a specific part of the frame, but perhaps there is already a ready-made implementation for this?

    I’ve attached a screenshot and a short AVI clip showing the problem I’m trying to fix.

    Image
    [Attachment 93471 - Click to enlarge]
    Image Attached Files
    Quote Quote  
  2. Code:
    LWLibavVideoSource("example-1.avi") 
    
    left = Crop(0,0,112,-0)
    mid = Crop(110,0,64,-0).ColorYUV(off_y=-3)
    right = Crop(174,0,-0,-0)
    
    StackHorizontal(left, mid, right)
    Using Overlay() and an alpha mask you could smooth out the edges.
    Quote Quote  
  3. Alternatively consider shifting the superblacks (y~10...13) up by ~3...4 steps.
    Quote Quote  
  4. Originally Posted by jagabo View Post
    Code:
    LWLibavVideoSource("example-1.avi") 
    
    left = Crop(0,0,112,-0)
    mid = Crop(110,0,64,-0).ColorYUV(off_y=-3)
    right = Crop(174,0,-0,-0)
    
    StackHorizontal(left, mid, right)
    Using Overlay() and an alpha mask you could smooth out the edges.
    Thanks! I have to study overlay & masking (Crop-approach was something I was familiar with, but using only that alone leaves visible lines)
    Quote Quote  
  5. Originally Posted by Sharc View Post
    Alternatively consider shifting the superblacks (y~10...13) up by ~3...4 steps.
    Thanks for noticing that . My capturing method is able to capture wider than 16-235. Also, if I have understood it right, levels over 16-235 causes problems only if I would do RGB -> YUV conversion somewhere at the process? (usually I try to keep captures in 16-235 range).
    Quote Quote  
  6. Y levels below 16 will all be crushed to 0, and levels above 235 will all be crushed at 255 upon a limited range YUV to full range RGB conversion. Note that TVs convert YUV to RGB that way for display so super black and super white details will be lost (there will be no visible detail in those areas).
    Quote Quote  
  7. Originally Posted by jagabo View Post
    Y levels below 16 will all be crushed to 0, and levels above 235 will all be crushed at 255 upon a limited range YUV to full range RGB conversion. Note that TVs convert YUV to RGB that way for display so super black and super white details will be lost (there will be no visible detail in those areas).
    So this has not been clear to me. I had understood that the conversation from YUV to RGB is not problematic but problems raises if there would be transformation back from RGB to YUV. Fortunately, I have generally kept the captures within the 16–235 range. I need to do some own testing to understand this a little bit better, generate somehow a gradient image from pure white (255) to pure black (0) and see what happens at different phases / converastion steps
    Last edited by Rolletus; 18th Aug 2026 at 07:20.
    Quote Quote  
  8. Good exercise, yes. Here is an example with Y (0....255), as shown on top.
    The YUV video has been decoded using the standard Rec.601 (TV) matrix, therfore you can't distinguish the bars Y<16 and Y>235 as these became RGB(0,0,0) or RGB(255,255,255) respectively.
    If it had been decoded using the PC.601 matrix one would see the superblacks and superwhite bars.
    What your TV actually does depends on its renderer. Usually it uses "studio equations (matrix)" acc. ITU recommendations. So it may show (some of) the superblacks and superwhites, but these are normally intended as margins for over-/undershoots and other imperfections. That's why staying in the 16....235 luma range is good practice - at least for the final distribution.
    Image Attached Thumbnails Click image for larger version

Name:	Y 0...255.png
Views:	4
Size:	46.5 KB
ID:	93479  

    Last edited by Sharc; 18th Aug 2026 at 05:58.
    Quote Quote  



Similar Threads

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