VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    After much searching I can't find an equivalent filter to the 32-bit Chromashift (or VDub's Flaxen VHS filter).

    Does anybody have any alternatives?
    Quote Quote  
  2. I have two suggestions. One would be Adobe After Effects 'cause it has built-in effects and plugins you can combine to create a VHS look. And the 2nd one is DaVinci Resolve - this video editing software has tools for adding film grain, adjusting colors, and adding noise to achieve a VHS effect...
    Quote Quote  
  3. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    No, that is clearly NOT what I am after.
    Quote Quote  
  4. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Found it. ChromashiftSP.
    Quote Quote  
  5. Why not just shift chroma directly? Should be not difficult and you can perform subpixel shift.
    Quote Quote  
  6. Yes, I agree with pandy. You don't need a separate filter. For example:

    A=AVISource("Video.avi")
    B=A.Greyscale()
    Overlay(B,A,X=3,Mode="Chroma")#moves to the right 3 pixels
    MergeChroma(aWarpSharp(depth=20))#Sharpens Chroma - needs aWarpsharp
    Quote Quote  
  7. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thanks Manono, ChromashiftSP is only one line of code and the coordinate inputs (L/R and Up/Down) are relatively intuitive (would have been nice to have the X the other way round!).

    ChromaShiftSP(X=3.2, Y=-1.6)
    Quote Quote  
  8. Sure, I understand. However, I made it longer than necessary. It can be done using 2 lines if not including the source line and the sharpening line.
    A=Last.Greyscale()
    Overlay(A,Last,X=3,Mode="Chroma")#moves to the right 3 pixels

    Still twice as many lines as using the filter, though.
    Quote Quote  
  9. Originally Posted by manono View Post
    Sure, I understand. However, I made it longer than necessary. It can be done using 2 lines if not including the source line and the sharpening line.
    A=Last.Greyscale()
    Overlay(A,Last,X=3,Mode="Chroma")#moves to the right 3 pixels

    Still twice as many lines as using the filter, though.
    You need to have filter in first place so...

    If something can be done autonomous, without using additional, third party solution then it is always better...
    Quote Quote  
  10. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    If something can be done autonomous, without using additional, third party solution then it is always better...
    +1
    Quote Quote  
  11. chromashiftsp is just a wrapper function using the internal functions MergeChroma and Spline16Resize (you can change the resampling algorithm if you want) . ie. it does not use additional third party solutions beyond the avisynth core .dll

    Or I guess it depends on how you define "third party solutions"

    Code:
    #ChromaShift_SP: Shift chroma with subpixel accuracy, basic function by IanB, made standalone by McCauley
    
    function ChromaShiftSP (clip clp, float "X",float "Y") {
    
    X = default(X, 0.0) # positive values shift the chroma to left, negative values to right
    Y = default(Y, 0.0) # positive values shift the chroma upwards, negative values downwards
    
    w = clp.Width()
    h = clp.Height()
    
    clp.MergeChroma(clp.Spline16Resize(w, h, X, Y, w+X, h+Y)) }
    Overlay can use one line too

    Code:
    Overlay(Last.Greyscale(),Last,X=3,Mode="Chroma")#moves to the right 3 pixels
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    Or I guess it depends on how you define "third party solutions"
    Well, obviously external filter you need to download to perform some action - this is from my perspective 3-rd party solution.
    Quote Quote  
  13. Originally Posted by pandy View Post
    Originally Posted by poisondeathray View Post
    Or I guess it depends on how you define "third party solutions"
    Well, obviously external filter you need to download to perform some action - this is from my perspective 3-rd party solution.
    You don't need to download anything. Copy / Paste the function . It's shifting the chroma directly (by resampling), based on internal functions .

    An external .dll is something you need to download, that is not included in the avisynth core .dll . That is something I would call that a 3rd party solution
    Quote Quote  
  14. Originally Posted by manono View Post
    Sure, I understand. However, I made it longer than necessary. It can be done using 2 lines if not including the source line and the sharpening line.
    A=Last.Greyscale()
    Overlay(A,Last,X=3,Mode="Chroma")#moves to the right 3 pixels

    Still twice as many lines as using the filter, though.
    You can reduce that to one line easily. There's no need to create a named greyscale version of the video. You can create it right in the call to Overlay:

    Code:
    Overlay(GreyScale,Last,X=3,Mode="Chroma")
    Obviously you can also include a vertical shift just by adding Y=N to the list of arguments. But that method lacks the subpixel accuracy of ChromaShiftSP.

    OMG. While comparing the two methods, I just noticed there's a bug in ChromaShiftSP(). The amount it shifts varies across the frame:

    Image
    [Attachment 71466 - Click to enlarge]


    On the top is a row of alternating grey and green boxes. In the middle row is manono's method using overlay to shift the chroma 8 pixels to the right, Overlay(GreyScale,Last,X=0, Y=8, Mode="Chroma"). The shift is consistent all across the frame. On the bottom is ChromaShiftSP(x=-8). At the left of the frame the shift is correct, but at the right the chroma is shifted twice as much. The same thing happens on the Y axis (not shown here).

    This can be fixed by changing ChromShiftSP's last line from:

    Code:
    clp.MergeChroma(clp.Spline16Resize(w, h, X, Y, w+X, h+Y)) }
    to:

    Code:
    clp.MergeChroma(clp.Spline16Resize(w, h, X, Y, w, h)) }
    Is this an issue with the way different versions of AviSynth deal with out-of-frame pixels in Spline36Resize()? I'm using AviSynth+, v. 3.7.3.

    Code:
    StackHorizontal(BlankClip(width=64, height=64, color=color_green), \
                    BlankClip(width=64, height=64, color=color_gray))
    StackHorizontal(last, last, last, last, last)
    #StackVertical(last, Invert())
    ConvertToYV24()
    
    v0 = last
    v1 = Overlay(GreyScale,Last,X=8, Y=0, Mode="Chroma")
    v2 = ChromaShiftSP(x=-8, y=0)
    
    StackVertical(v0.Subtitle("original"), v1.Subtitle("overlay"), v2.Subtitle("ChromaShiftSP"))
    Quote Quote  
  15. There is a modified chromashiftsp2 , the changelog says fix incorrect shifting - can you check jagabo ?
    https://github.com/Asd-g/AviSynthPlus-Scripts/blob/master/ChromaShiftSP2_.avsi

    Code:
    # ChromaShiftSP2: Shift U & V chroma separately with subpixel accuracy, based on the ChromaShiftSP function by IanB & McCauley
    # https://forum.doom9.org/showthread.php?p=1851933#post1851933
    
    
    ### Changelog ###
    #---------------
    # Fix incorrect shifting.
    #---------------
    # Changed UX/UY/VX/VY from chroma pixels to luma pixels.
    #---------------
    # Added high bit-depth support.
    
    
    Function ChromaShiftSP2 (clip clp, float "UX",float "UY", float "VX",float "VY", string "ResizeMethod")
    {
        UX = default(UX, 0.0) # positive values shift the U chroma to left, negative values to right
        UY = default(UY, 0.0) # positive values shift the U chroma upwards, negative values downwards
        VX = default(VX, 0.0) # positive values shift the V chroma to left, negative values to right
        VY = default(VY, 0.0) # positive values shift the V chroma upwards, negative values downwards
        ResizeMethod = Default(ResizeMethod, "Spline36")
    
        ucw = (Is420(clp) || Is422(clp)) ? UX / 2.0 : UX
        uch = (Is444(clp) || Is422(clp)) ? UY : UY / 2.0
        vcw = (Is420(clp) || Is422(clp)) ? VX / 2.0 : VX
        vch = (Is444(clp) || Is422(clp)) ? VY : VY / 2.0
    
        uvw = (!Is444(clp)) ? Width(clp) / 2 : Width(clp)
        uvh = (Is420(clp)) ? Height(clp) / 2 : Height(clp)
    
        U = ExtractU(clp).Eval(+ ResizeMethod + "Resize(uvw, uvh, src_left=ucw, src_top=uch)")
        V = ExtractV(clp).Eval(+ ResizeMethod + "Resize(uvw, uvh, src_left=vcw, src_top=vch)")
    
        Return CombinePlanes(clp, U, V, planes="YUV", source_planes="YYY", sample_clip=clp)
    }

    One issue with overlay method, is it does not accept decimals
    Quote Quote  
  16. Yes, that updated ChromaShiftSP2 fixes the problem (as well as offering additional features). The result looks the same as my proposed fix:

    Image
    [Attachment 71467 - Click to enlarge]
    Quote Quote  
  17. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    PDR, sorry about that, by "3rd party" I really just meant "replacement", but I had a Virtual Dub "3rd party" filter mindset, although, I think I had to manually add ChromashiftSP to my plugins folder.

    Musing now, I wonder why would a programmer would make X values to the right of 0 negative? This stuff is hard enough to grasp anyway; to throw in that seems odd to me.

    I always wondered what Chroma I and Chroma Q was in Flaxen's VDub plugin; I guess that is what ChromashiftSP2 is doing with the separate U and V movement?

    Image
    [Attachment 71468 - Click to enlarge]
    Quote Quote  
  18. Originally Posted by Alwyn View Post
    Musing now, I wonder why would a programmer would make X values to the right of 0 negative? This stuff is hard enough to grasp anyway; to throw in that seems odd to me.
    Yes, that always annoyed me too. You could fix it by negating the X and Y values to Spline36Resize. In addition to my earlier fix:

    Code:
    clp.MergeChroma(clp.Spline16Resize(w, h, -X, -Y, w, h)) }
    That will match manono's Overlay method. I never bothered to "fix" that because then my version would be different than everybody else's.

    Originally Posted by Alwyn View Post
    I always wondered what Chroma I and Chroma Q was in Flaxen's VDub plugin; I guess that is what ChromashiftSP2 is doing with the separate U and V movement?
    I don't know about the Flaxen filter in particular. But the I/Q system is a different rotation of the chroma. You should be able to get similar results by Tweaking the hue, shifting the chroma, then rotating the hue back to normal.
    Last edited by jagabo; 3rd Jun 2023 at 20:43.
    Quote Quote  
  19. Originally Posted by poisondeathray View Post
    Overlay can use one line too

    Overlay(Last.Greyscale(),Last,X=3,Mode="Chroma")#m oves to the right 3 pixels
    Thanks, I can use that. I was pretty sure it could be compressed further, but didn't know how to do it.
    Quote Quote  
  20. Originally Posted by poisondeathray View Post
    You don't need to download anything. Copy / Paste the function . It's shifting the chroma directly (by resampling), based on internal functions .
    An external .dll is something you need to download, that is not included in the avisynth core .dll . That is something I would call that a 3rd party solution
    I blame my poor English for your misunderstanding, apologies for this, as i wrote earlier https://forum.videohelp.com/threads/409823-64-Bit-AVISynth-Any-Comparable-Filter-for-3...ft#post2692105 instead external filter it is better to get desired functionality with already owned tools. ChromashiftSP fulfill this, opposite to Chromashift (external plugin) - i didn't checked if ChromashiftSP is external filter or function.

    That's all from my side - hope it is clear now.
    Quote Quote  



Similar Threads

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