VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. I'm looking for a little script to filter borders only: top/bottom (and maybe left/right). I already have one but i wasn't able to tweak it so far; i can filter one border at a time.
    The code i use:
    ###############s
    # Border Top
    X1 = 0
    Y1 = 0
    X2 = 720
    Y2 = 26
    ## Border Bottom
    #X1 = 0
    #Y1 = 418
    #X2 = 720
    #Y2 =480

    # Make the values MOD4
    X1 = X1 - (X1 % 4)
    Y1 = Y1 - (y1 % 4)
    X2 = (X2 + 3) / 4 * 4
    Y2 = (Y2 + 3) / 4 * 4
    Active = crop(X1,Y1,X2-X1,Y2-Y1)
    Above = Y1 > 0 ? crop(0,0,width(),Y1) : NOP
    Below = Y2 < height() ? crop(0,Y2,width(),height()-Y2) : NOP
    Left = X1 > 0 ? crop(0,Y1,X1,Y2-Y1) : NOP
    Right = X2 < width() ? crop(X2,Y1,width()-X2,Y2-Y1) : NOP
    Last = Active
    ##########
    # Put filters here:
    grayscale()

    ##########
    IsClip(Left) ? StackHorizontal(Left, Last) : NOP
    IsClip(Right) ? StackHorizontal(Last, Right) : NOP
    IsClip(Above) ? StackVertical(Above, Last) : NOP
    IsClip(Below) ? StackVertical(Last, Below) : NOP
    return Last
    *** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE
    Quote Quote  
  2. Code:
    function filter_borders(clip c, int Left, int Top, int Right, int Bottom)
    {
      # Left = size of left border
      # Top = size of top border
      # Right = size of right border
      # Bottom = size of bottom border
    
      inner = Crop(c, Left, Top, -Right, -Bottom)
      GreyScale(c) # or whatever filters you want
      Overlay(last, inner, Left, Top) # overlay unfiltered inner portion
    }
    Of course, it's slower since the entire frame is filtered, then the inner portion is overlaid with the unfiltered portion.
    Last edited by jagabo; 20th Dec 2016 at 18:58.
    Quote Quote  
  3. This may not be exactly what you had in mind, but this is another way to filter only the outside borders, but without making it a function:

    A=Last
    B=BlankClip(A, color = $ff0000)###Filter here, in this case create a red border
    A=A.Crop(16,8,-16,-8)###Define the border area
    Overlay(B,A,16,8)
    Image Attached Thumbnails Click image for larger version

Name:	BorderFilter.jpg
Views:	125
Size:	108.8 KB
ID:	39991  

    Quote Quote  
  4. Thank you both, i'm using jagabo solution for now
    *** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE
    Quote Quote  



Similar Threads

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