logo Sign In

Post #597767

Author
althor1138
Parent topic
Three-strip Technicolor: Please help!
Link to post in topic
https://originaltrilogy.com/post/id/597767/action/topic#597767
Date created
23-Sep-2012, 5:45 PM

Well I've tried my hand at it based upon the page you linked to in your first script.  I'm not sure if I've come up with something good or wasted a bunch of my time lol.  It seems to not work well at all with scenes that have been color corrected beforehand.  I'm going to post it here just so maybe somebody can perhaps improve it or point out anything wrong with it.  I tested it on a few home videos and the results seemed pretty good imo.

 

It assumes you are feeding it a clip with YUV colorspace.

Function Technicolor(clip source, float "colorsat", bool "autowhites",bool "showdif")
{
    #Set Defaults
    colorsat=Default(colorsat,1.6)
    autowhites=Default(autowhites,true)
    showdif=Default(showdif,false)
   
    srgb=source.converttorgb()
    global red=srgb.showred("YV12")#.tweak(bright=25)
    global green=srgb.showgreen("YV12")#.tweak(bright=25)
    global blue=srgb.showblue("YV12")#.tweak(bright=25)
    cyan=source.tweakcolor(starthue=321,endhue=259,sat=0,bright=-255).tweak(sat=1.3).converttorgb().greyscale().converttoyv12()
    magenta=source.tweakcolor(starthue=81,endhue=19,sat=0,bright=-255).tweak(sat=1.3).converttorgb().greyscale().converttoyv12()
    yellow=source.tweakcolor(starthue=201,endhue=139,sat=0,bright=-255).tweak(sat=1.3).converttorgb().greyscale().converttoyv12()
    yellowmask=yellow.levels(0,1,1,0,255).converttorgb()
    global magyel=overlay(magenta,yellow,mask=yellowmask,mode="luma",opacity=1)
    global cyayel=overlay(cyan,yellow,mask=yellowmask,mode="luma",opacity=1)
    magmask=magenta.levels(0,1,1,0,255).converttorgb()
    global cyamag=overlay(cyan,magenta,mask=magmask,mode="luma",opacity=1)
    newred=scriptclip(red,"coloryuv(off_y=(averageluma(red)/2-averageluma(magyel)*1.5))")
    newgreen=scriptclip(green,"coloryuv(off_y=(averageluma(green)/2-averageluma(cyayel)*1.5))")
    newblue=scriptclip(blue,"coloryuv(off_y=(averageluma(blue)/2-averageluma(cyamag)*1.5))")
    tc=mergergb(newred,newgreen,newblue)
    mix=overlay(source,tc,mode="chroma",opacity=1).tweak(sat=colorsat).coloryuv(autowhite=autowhites)
    comp=stackhorizontal(source.subtitle("ORIGINAL",x=-1,y=400),mix.subtitle("TECHNICOLOR ?",x=-1,y=400))
   
    return((showdif) ? comp : mix)
   
}