04-23-2021, 11:39 PM | #1 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Sharpen video in Reaper
Hello, is it possible to add simple code to sharpen videos in Reaper?
Professionally there are three settings - one that sharpens or gives more contrast to pixels, the other sets the radius of the contrast and the third setting is the amount of treshold (in order to concentrate on the detailed foreground).
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
04-24-2021, 01:36 AM | #2 |
Human being with feelings
Join Date: Aug 2015
Posts: 2,969
|
I'm sure somebody has done a sharpen preset - although I can't find one right now.
There's things you can do by mixing in a (colour) inverted blurred copy of the original.
__________________
it's meant to sound like that... |
04-24-2021, 10:50 AM | #3 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Thanks, I can not find any either.
Tried to invert a track copy of image colours and now how you mean I mix them together? I did put image overlay, but they do not mix well, also if I set opacity.
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
04-25-2021, 06:20 AM | #4 |
Human being with feelings
Join Date: Aug 2015
Posts: 2,969
|
attached a track template that does a kind of video sharpening
__________________
it's meant to sound like that... |
04-25-2021, 01:59 PM | #5 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Thank you. Have tried it but it does not work for me. Contrast brightness works in a similar way. Videos are heavilly unsharp ...
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
04-25-2021, 02:27 PM | #6 |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Hi - thanks for this - I've been looking for a video sharpening processor.
I too did not notice much with the blur low quality processor. But I swapped it for the Gaussian blur - and it worked much better for me. So I then thought I'd try and amalgamate it all into a single processor - and came up with this: Code:
// Sharpen //@param1:sigma_parm 'Amount' 0 0 5 2.5 0.01 ////@param2:weight_mod 'Y modifier' 1 .25 4 1.0 0.01 //@param2:merge 'Merge' 0.74 0.7 0.75 0.725 0.001 ////@param9:force_rgb 'force RGB' 0 0 1 .5 1 //@param4:brightness 'brightness' 0.0 -2 2 //@param5:contrast 'contrast' 1.14 0 2 ////@param15:brightness2 'brightness pre' 0.0 -1 1 ////@param16:contrast2 'contrast big' 1.0 -50 50 //@param6:saturation 'saturation-ish' 1.9 -10 10 function bd(flag) ( sigma = sigma_parm * ((flag&8)?weight_mod:1/weight_mod); sigma > 0.5 ? ( // thanks wwwmaze for this algorithm :) q = sigma <=2.5 ? 3.97156-4.14554*sqrt(1-0.26891*sigma) : 0.98711*sigma-0.96330; b0 = 1.57825 + 2.44413*q + 1.4281*q^2 + 0.422205*q^3; b1 = 2.44413*q + 2.85619*q^2 + 1.26661*q^3; b2 = -1.4281*q^2 - 1.26661*q^3; b3 = 0.422205*q^3; BB = 1-(b1+b2+b3)/b0; b1b0=b1/b0; b2b0=b2/b0; b3b0=b3/b0; rowsize = ((flag&8) ? project_h : project_w); rowsize -= 1 + (colorspace=='YV12' ? rowsize*.5); gfx_evalrect(0,0,project_w,project_h, colorspace=='RGBA' ? " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=r; _32=_22=_12=g; _33=_23=_13=b; ); r=BB*r + b1b0*_11 + b2b0*_21 +b3b0*_31; _31=_21; _21=_11; _11=r; g=BB*g + b1b0*_12 + b2b0*_22 +b3b0*_32; _32=_22; _22=_12; _12=g; b=BB*b + b1b0*_13 + b2b0*_23 +b3b0*_33; _33=_23; _23=_13; _13=b; " : " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=y1; _32=_22=_12=y3; _33=_23=_13=u; _34=_24=_14=v; ); y1=BB*y1 + b1b0*_11 + b2b0*_21 +b3b0*_31; y2=BB*y2 + b1b0*y1 + b2b0*_11 +b3b0*_21; _31=_11; _21=y1; _11=y2; y3=BB*y3 + b1b0*_12 + b2b0*_22 +b3b0*_32; y4=BB*y4 + b1b0*y3 + b2b0*_12 +b3b0*_22; _32=_12; _22=y3; _12=y4; _90=BB*u + b1b0*_13 + b2b0*_23 +b3b0*_33; u=BB*u + b1b0*_90 + b2b0*_13 +b3b0*_23; _33=_13; _23=_90; _13=u; _91=BB*v + b1b0*_14 + b2b0*_24 +b3b0*_34; v=BB*v + b1b0*_91 + b2b0*_14 +b3b0*_24; _34=_14; _24=_91; _14=v; ",flag ); ); ); brightness2 = 0; contrast2 = 1; force_rgb = 0; weight_mod = 1; in=input_info(input=0,project_w,project_h); bimg1 = gfx_img_alloc(project_w,project_h,1); bimg2 = gfx_img_alloc(project_w,project_h,1); (cv=abs(contrast*contrast2)) > 1 ? cv = (cv-1)*4 + 1; cv=((2^cv)-1) * sign(contrast*contrast2); i=tab=0; loop(256, v = i/256; tab[i]=(v-0.5+brightness2)*cv+0.5+brightness; tab[i+256]=tab[i+512]=0.5 + (v-0.5)*saturation; i+=1; ); gfx_dest = bimg1; gfx_set(1); gfx_fillrect(0,0,project_w,project_h); gfx_set(0,0,0,-1,1); // negative alpha, additive in ? ( // INVERT gfx_blit(input, 0); //pa && colorspace=='RGBA' ? ( gfx_mode=0xf0+3+3*4; gfx_blit(input,0); ); gfx_set(0,0,0,1,0,-1); //BLUR gfx_dest = bimg2; colorspace!='RGBA' ? colorspace='YV12'; gfx_blit(bimg1); /*want_l ?*/ bd(4); /*want_d ?*/ bd(8); /*want_u ?*/ bd(4|8); /*want_r ?*/ bd(0); gfx_a = merge; gfx_blit(input); ); gfx_dest = -1; gfx_a = 1; gfx_blit(bimg2); //tab[0] > 0 ? ( colorspace!='YUY2' ? colorspace='YV12'; gfx_procrect(0,0,project_w,project_h,tab); //); //gfx_blit(bimg2, 1); gfx_img_free(bimg1); gfx_img_free(bimg2); And I reduced the range of the Amount control (originally named Sigma in the gaussian blur processor) - to something more useful (the range where for me it gets better as you increase it - and then starts to degrade again). Anyway - I've really not much of an idea of what I'm doing with video processor stuff - but it seems to work pretty well - and you can stack them for even more sharpness - with obvious further colour degradation... Hope it might be useful
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website Last edited by lb0; 04-25-2021 at 02:54 PM. |
04-25-2021, 03:05 PM | #7 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Great, this indeed works. How about combining RGB values, since it breaks also white balance in the same code? I am not sure how to do that.
Here is some simple RGB code: //RGB White Balance Colour Grading src=0; //@param2:red 'red' 0 -0.1 0.1 //@param4:green 'green' 0 -0.1 0.1 //@param6:blue 'blue' 0 -0.1 0.1 //@param8:intensity 'intensity' 1 -10 10 input_info(src,w,h) ? ( project_w=w; project_h=h; ); // preserve input dimensions w>0 ? gfx_blit(src); gfx_mode=w>0 ? 1 : 0; gfx_gradrect(0,0,project_w,project_h, red, green, blue, intensity);
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
04-25-2021, 03:19 PM | #8 | |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Quote:
I'm not sure if the CPU for what I've done can be reduced at all - I basically copied the processors involved in jrk's track template example but swapped in the gaussian blur. It seems to be the gaussian blur causing the big jump in CPU - as if you lower the amount to 0 - it reduces massively...
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website |
|
04-25-2021, 03:23 PM | #9 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Well, it can be separate if you think that it is to heavy (does not look to bad on rendering now - ussual load for Gaussian blur). I did put it second, behind your sharpen code.
But I also noticed it only needs to lift Blue and Red in the same amount. So perhaps that helps if the code can get improved to do this automatically.
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. Last edited by urednik; 04-25-2021 at 03:36 PM. |
04-25-2021, 03:38 PM | #10 | |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Quote:
Code:
// Sharpen //@param1:sigma_parm 'Amount' 0 0 5 2.5 0.01 ////@param2:weight_mod 'Y modifier' 1 .25 4 1.0 0.01 //@param2:merge 'Merge' 0.715 0.7 0.75 0.725 0.001 ////@param9:force_rgb 'force RGB' 0 0 1 .5 1 //@param4:brightness 'brightness' 0.0 -2 2 //@param5:contrast 'contrast' 1.14 0 2 ////@param15:brightness2 'brightness pre' 0.0 -1 1 ////@param16:contrast2 'contrast big' 1.0 -50 50 //@param6:saturation 'saturation-ish' 1.9 -10 10 //@param8:red 'balance' 0 -0.1 0.1 ////@param9:green 'green' 0 -0.1 0.1 ////@param10:blue 'blue' 0 -0.1 0.1 //@param9:intensity 'intensity' 1 -10 10 function bd(flag) ( sigma = sigma_parm * ((flag&8)?weight_mod:1/weight_mod); sigma > 0.5 ? ( // thanks wwwmaze for this algorithm :) q = sigma <=2.5 ? 3.97156-4.14554*sqrt(1-0.26891*sigma) : 0.98711*sigma-0.96330; b0 = 1.57825 + 2.44413*q + 1.4281*q^2 + 0.422205*q^3; b1 = 2.44413*q + 2.85619*q^2 + 1.26661*q^3; b2 = -1.4281*q^2 - 1.26661*q^3; b3 = 0.422205*q^3; BB = 1-(b1+b2+b3)/b0; b1b0=b1/b0; b2b0=b2/b0; b3b0=b3/b0; rowsize = ((flag&8) ? project_h : project_w); rowsize -= 1 + (colorspace=='YV12' ? rowsize*.5); gfx_evalrect(0,0,project_w,project_h, colorspace=='RGBA' ? " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=r; _32=_22=_12=g; _33=_23=_13=b; ); r=BB*r + b1b0*_11 + b2b0*_21 +b3b0*_31; _31=_21; _21=_11; _11=r; g=BB*g + b1b0*_12 + b2b0*_22 +b3b0*_32; _32=_22; _22=_12; _12=g; b=BB*b + b1b0*_13 + b2b0*_23 +b3b0*_33; _33=_23; _23=_13; _13=b; " : " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=y1; _32=_22=_12=y3; _33=_23=_13=u; _34=_24=_14=v; ); y1=BB*y1 + b1b0*_11 + b2b0*_21 +b3b0*_31; y2=BB*y2 + b1b0*y1 + b2b0*_11 +b3b0*_21; _31=_11; _21=y1; _11=y2; y3=BB*y3 + b1b0*_12 + b2b0*_22 +b3b0*_32; y4=BB*y4 + b1b0*y3 + b2b0*_12 +b3b0*_22; _32=_12; _22=y3; _12=y4; _90=BB*u + b1b0*_13 + b2b0*_23 +b3b0*_33; u=BB*u + b1b0*_90 + b2b0*_13 +b3b0*_23; _33=_13; _23=_90; _13=u; _91=BB*v + b1b0*_14 + b2b0*_24 +b3b0*_34; v=BB*v + b1b0*_91 + b2b0*_14 +b3b0*_24; _34=_14; _24=_91; _14=v; ",flag ); ); ); brightness2 = 0; contrast2 = 1; force_rgb = 0; weight_mod = 1; in=input_info(input=0,project_w,project_h); bimg1 = gfx_img_alloc(project_w,project_h,1); bimg2 = gfx_img_alloc(project_w,project_h,1); (cv=abs(contrast*contrast2)) > 1 ? cv = (cv-1)*4 + 1; cv=((2^cv)-1) * sign(contrast*contrast2); i=tab=0; loop(256, v = i/256; tab[i]=(v-0.5+brightness2)*cv+0.5+brightness; tab[i+256]=tab[i+512]=0.5 + (v-0.5)*saturation; i+=1; ); gfx_dest = bimg1; gfx_set(1); gfx_fillrect(0,0,project_w,project_h); gfx_set(0,0,0,-1,1); // negative alpha, additive in ? ( // INVERT gfx_blit(input, 0); //pa && colorspace=='RGBA' ? ( gfx_mode=0xf0+3+3*4; gfx_blit(input,0); ); gfx_set(0,0,0,1,0,-1); //BLUR gfx_dest = bimg2; colorspace!='RGBA' ? colorspace='YV12'; gfx_blit(bimg1); /*want_l ?*/ bd(4); /*want_d ?*/ bd(8); /*want_u ?*/ bd(4|8); /*want_r ?*/ bd(0); gfx_a = merge; gfx_blit(input); ); gfx_dest = -1; gfx_a = 1; gfx_blit(bimg2); //tab[0] > 0 ? ( colorspace!='YUY2' ? colorspace='YV12'; gfx_procrect(0,0,project_w,project_h,tab); //); //colorspace='RGBA'; gfx_mode=1; gfx_gradrect(0,0,project_w,project_h, red, 0, red, intensity); //gfx_blit(bimg2, 1); gfx_img_free(bimg1); gfx_img_free(bimg2); EDIT2: There are probably some parameters that only require fixed values - but not being an expert here I've made them adjustable - so if you think anything needs fixed values - let me know...
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website Last edited by lb0; 04-25-2021 at 03:45 PM. |
|
04-25-2021, 04:12 PM | #11 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Wow, yes that is even better now, though do not know why, but with those separate RGB settings I could replicate WB better. But your idea is brilliant!
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
04-25-2021, 04:15 PM | #12 | |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Quote:
EDIT: Separate RGB version for WB. Code:
// Sharpen //@param1:sigma_parm 'Amount' 0 0 5 2.5 0.01 ////@param2:weight_mod 'Y modifier' 1 .25 4 1.0 0.01 //@param2:merge 'Merge' 0.715 0.7 0.75 0.725 0.001 ////@param9:force_rgb 'force RGB' 0 0 1 .5 1 //@param4:brightness 'brightness' 0.0 -2 2 //@param5:contrast 'contrast' 1.14 0 2 ////@param15:brightness2 'brightness pre' 0.0 -1 1 ////@param16:contrast2 'contrast big' 1.0 -50 50 //@param6:saturation 'saturation-ish' 1.9 -10 10 //@param8:red 'red' 0 -0.1 0.1 //@param9:green 'green' 0 -0.1 0.1 //@param10:blue 'blue' 0 -0.1 0.1 //@param11:intensity 'intensity' 1 -10 10 function bd(flag) ( sigma = sigma_parm * ((flag&8)?weight_mod:1/weight_mod); sigma > 0.5 ? ( // thanks wwwmaze for this algorithm :) q = sigma <=2.5 ? 3.97156-4.14554*sqrt(1-0.26891*sigma) : 0.98711*sigma-0.96330; b0 = 1.57825 + 2.44413*q + 1.4281*q^2 + 0.422205*q^3; b1 = 2.44413*q + 2.85619*q^2 + 1.26661*q^3; b2 = -1.4281*q^2 - 1.26661*q^3; b3 = 0.422205*q^3; BB = 1-(b1+b2+b3)/b0; b1b0=b1/b0; b2b0=b2/b0; b3b0=b3/b0; rowsize = ((flag&8) ? project_h : project_w); rowsize -= 1 + (colorspace=='YV12' ? rowsize*.5); gfx_evalrect(0,0,project_w,project_h, colorspace=='RGBA' ? " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=r; _32=_22=_12=g; _33=_23=_13=b; ); r=BB*r + b1b0*_11 + b2b0*_21 +b3b0*_31; _31=_21; _21=_11; _11=r; g=BB*g + b1b0*_12 + b2b0*_22 +b3b0*_32; _32=_22; _22=_12; _12=g; b=BB*b + b1b0*_13 + b2b0*_23 +b3b0*_33; _33=_23; _23=_13; _13=b; " : " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=y1; _32=_22=_12=y3; _33=_23=_13=u; _34=_24=_14=v; ); y1=BB*y1 + b1b0*_11 + b2b0*_21 +b3b0*_31; y2=BB*y2 + b1b0*y1 + b2b0*_11 +b3b0*_21; _31=_11; _21=y1; _11=y2; y3=BB*y3 + b1b0*_12 + b2b0*_22 +b3b0*_32; y4=BB*y4 + b1b0*y3 + b2b0*_12 +b3b0*_22; _32=_12; _22=y3; _12=y4; _90=BB*u + b1b0*_13 + b2b0*_23 +b3b0*_33; u=BB*u + b1b0*_90 + b2b0*_13 +b3b0*_23; _33=_13; _23=_90; _13=u; _91=BB*v + b1b0*_14 + b2b0*_24 +b3b0*_34; v=BB*v + b1b0*_91 + b2b0*_14 +b3b0*_24; _34=_14; _24=_91; _14=v; ",flag ); ); ); brightness2 = 0; contrast2 = 1; force_rgb = 0; weight_mod = 1; in=input_info(input=0,project_w,project_h); bimg1 = gfx_img_alloc(project_w,project_h,1); bimg2 = gfx_img_alloc(project_w,project_h,1); (cv=abs(contrast*contrast2)) > 1 ? cv = (cv-1)*4 + 1; cv=((2^cv)-1) * sign(contrast*contrast2); i=tab=0; loop(256, v = i/256; tab[i]=(v-0.5+brightness2)*cv+0.5+brightness; tab[i+256]=tab[i+512]=0.5 + (v-0.5)*saturation; i+=1; ); gfx_dest = bimg1; gfx_set(1); gfx_fillrect(0,0,project_w,project_h); gfx_set(0,0,0,-1,1); // negative alpha, additive in ? ( // INVERT gfx_blit(input, 0); //pa && colorspace=='RGBA' ? ( gfx_mode=0xf0+3+3*4; gfx_blit(input,0); ); gfx_set(0,0,0,1,0,-1); //BLUR gfx_dest = bimg2; colorspace!='RGBA' ? colorspace='YV12'; gfx_blit(bimg1); /*want_l ?*/ bd(4); /*want_d ?*/ bd(8); /*want_u ?*/ bd(4|8); /*want_r ?*/ bd(0); gfx_a = merge; gfx_blit(input); ); gfx_dest = -1; gfx_a = 1; gfx_blit(bimg2); //tab[0] > 0 ? ( colorspace!='YUY2' ? colorspace='YV12'; gfx_procrect(0,0,project_w,project_h,tab); //); //colorspace='RGBA'; gfx_mode=1; gfx_gradrect(0,0,project_w,project_h, red, green, blue, intensity); //gfx_blit(bimg2, 1); gfx_img_free(bimg1); gfx_img_free(bimg2);
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website Last edited by lb0; 04-25-2021 at 04:24 PM. |
|
04-25-2021, 11:44 PM | #13 |
Human being with feelings
Join Date: Aug 2015
Posts: 2,969
|
well, you certainly ran with that. Excellent.
(Yeah there's something funny with the low quality blur - it works when I instantiate it fresh, but doesn't when loaded from a track template).
__________________
it's meant to sound like that... |
04-26-2021, 01:18 AM | #14 | |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Quote:
Ok - tried adding the low quality blur - and it works too. Have added it as an option (default - because it uses less CPU). blur type 0 = gaussian blur type 1 = low quality The amount is not calibrated between the two blur types - so switching blur types is not going to provide the same strength sharpening - so currently it's not easy to compare quality between the two... Code:
// Sharpen ////@param1:sigma_parm 'Amount' 0 0 5 2.5 0.01 //@param1:amount 'Amount' 0 0 1 0.5 0.001 ////@param2:weight_mod 'Y modifier' 1 .25 4 1.0 0.01 //@param2:merge 'Merge' 0.715 0.7 0.75 0.725 0.001 ////@param9:force_rgb 'force RGB' 0 0 1 .5 1 //@param4:brightness 'brightness' 0.0 -2 2 //@param5:contrast 'contrast' 1.14 0 2 ////@param15:brightness2 'brightness pre' 0.0 -1 1 ////@param16:contrast2 'contrast big' 1.0 -50 50 //@param6:saturation 'saturation-ish' 1.9 -10 10 //@param8:red 'red' 0 -0.1 0.1 //@param9:green 'green' 0 -0.1 0.1 //@param10:blue 'blue' 0 -0.1 0.1 //@param11:intensity 'intensity' 1 -10 10 //@param13:blurtype 'blur type' 1 0 1 0.5 1 function bd2(flag) ( weight= min(weight_parm*((flag&8) ? weight_mod : 1/weight_mod),1) ^.25; weight2 = sqr(weight); rowsize = ((flag&8) ? project_h : project_w); rowsize -= 1 + (colorspace=='YV12' ? rowsize*.5); gfx_evalrect(0,0,project_w,project_h,colorspace=='RGBA' ? " (_1 -= 1) < 0 ? ( _1=rowsize; _2=r; _3=g; _4=b; ); r+=weight*(_2-r); _2=r; g+=weight*(_3-g); _3=g; b+=weight*(_4-b); _4=b; " : " (_1 -= 1) < 0 ? ( _1=rowsize; _2=y1; _3=y3; _4=u; _5=v; ); y1+=weight*(_2-y1); _2=(y2+=weight*(y1-y2)); y3+=weight*(_3-y3); _3=(y4+=weight*(y3-y4)); _4=(u+=weight2*(_4-u)); _5=(v+=weight2*(_5-v)); ",flag); ); function bd(flag) ( sigma = weight_parm * ((flag&8)?weight_mod:1/weight_mod); sigma > 0.5 ? ( // thanks wwwmaze for this algorithm :) q = sigma <=2.5 ? 3.97156-4.14554*sqrt(1-0.26891*sigma) : 0.98711*sigma-0.96330; b0 = 1.57825 + 2.44413*q + 1.4281*q^2 + 0.422205*q^3; b1 = 2.44413*q + 2.85619*q^2 + 1.26661*q^3; b2 = -1.4281*q^2 - 1.26661*q^3; b3 = 0.422205*q^3; BB = 1-(b1+b2+b3)/b0; b1b0=b1/b0; b2b0=b2/b0; b3b0=b3/b0; rowsize = ((flag&8) ? project_h : project_w); rowsize -= 1 + (colorspace=='YV12' ? rowsize*.5); gfx_evalrect(0,0,project_w,project_h, colorspace=='RGBA' ? " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=r; _32=_22=_12=g; _33=_23=_13=b; ); r=BB*r + b1b0*_11 + b2b0*_21 +b3b0*_31; _31=_21; _21=_11; _11=r; g=BB*g + b1b0*_12 + b2b0*_22 +b3b0*_32; _32=_22; _22=_12; _12=g; b=BB*b + b1b0*_13 + b2b0*_23 +b3b0*_33; _33=_23; _23=_13; _13=b; " : " (_1 -= 1) < 0 ? ( _1=rowsize; _31=_21=_11=y1; _32=_22=_12=y3; _33=_23=_13=u; _34=_24=_14=v; ); y1=BB*y1 + b1b0*_11 + b2b0*_21 +b3b0*_31; y2=BB*y2 + b1b0*y1 + b2b0*_11 +b3b0*_21; _31=_11; _21=y1; _11=y2; y3=BB*y3 + b1b0*_12 + b2b0*_22 +b3b0*_32; y4=BB*y4 + b1b0*y3 + b2b0*_12 +b3b0*_22; _32=_12; _22=y3; _12=y4; _90=BB*u + b1b0*_13 + b2b0*_23 +b3b0*_33; u=BB*u + b1b0*_90 + b2b0*_13 +b3b0*_23; _33=_13; _23=_90; _13=u; _91=BB*v + b1b0*_14 + b2b0*_24 +b3b0*_34; v=BB*v + b1b0*_91 + b2b0*_14 +b3b0*_24; _34=_14; _24=_91; _14=v; ",flag ); ); ); brightness2 = 0; contrast2 = 1; force_rgb = 0; weight_mod = 1; in=input_info(input=0,project_w,project_h); bimg1 = gfx_img_alloc(project_w,project_h,1); bimg2 = gfx_img_alloc(project_w,project_h,1); (cv=abs(contrast*contrast2)) > 1 ? cv = (cv-1)*4 + 1; cv=((2^cv)-1) * sign(contrast*contrast2); i=tab=0; loop(256, v = i/256; tab[i]=(v-0.5+brightness2)*cv+0.5+brightness; tab[i+256]=tab[i+512]=0.5 + (v-0.5)*saturation; i+=1; ); gfx_dest = bimg1; gfx_set(1); gfx_fillrect(0,0,project_w,project_h); gfx_set(0,0,0,-1,1); // negative alpha, additive in ? ( // INVERT gfx_blit(input, 0); //pa && colorspace=='RGBA' ? ( gfx_mode=0xf0+3+3*4; gfx_blit(input,0); ); gfx_set(0,0,0,1,0,-1); //BLUR gfx_dest = bimg2; blurtype == 0 ? ( weight_parm = amount * 5; colorspace!='RGBA' ? colorspace='YV12'; gfx_blit(bimg1); bd(4); bd(8); bd(4|8); bd(0); ) : ( weight_parm = amount * 0.65; colorspace!='RGBA' ? colorspace='YV12'; gfx_blit(bimg1); bd2(4); bd2(8); bd2(4|8); bd2(0); ); gfx_a = merge; gfx_blit(input); ); gfx_dest = -1; gfx_a = 1; gfx_blit(bimg2); //tab[0] > 0 ? ( colorspace!='YUY2' ? colorspace='YV12'; gfx_procrect(0,0,project_w,project_h,tab); //); //colorspace='RGBA'; gfx_mode=1; gfx_gradrect(0,0,project_w,project_h, red, green, blue, intensity); gfx_img_free(bimg1); gfx_img_free(bimg2);
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website |
|
04-27-2021, 12:58 AM | #15 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
Great! Thanks, I really appreciate this!
Should it be posted somewhere else or in some kind of stash?
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
04-29-2021, 03:06 AM | #16 | |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Quote:
It works though as it is - and pretty well with a little bit of tweaking - which I'm pretty happy about
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website |
|
01-23-2023, 08:22 PM | #17 |
Human being with feelings
Join Date: Feb 2017
Posts: 185
|
Hi I just tried this and ended up with something like this, which is cool! but not what I expected... https://youtu.be/4yBs-9EdZe4
|
01-24-2023, 02:08 AM | #18 | |
Human being with feelings
Join Date: Apr 2014
Posts: 4,171
|
Quote:
Hmmm. So was the sharpen tool responsible for the sound being like that too?? Weird - although - it is heavy on processing - so maybe that's responsible... But if it's just responsible for the blue video effect at the start - that's definitely unexpected and interesting! I personally wouldn't really use this sharpen technique on anything I do (as a video sharpen fx) - as I've had better results with practically every other sharpening tool I have (non-reaper). It was really just trying to package up this particular sharpening technique in a single plugin (by borrowing code from other video fx). I mean - it kind of works when you dial in the right parameters - but the result doesn't make me go wow. I've never had any results like that though - but I like it!!
__________________
Projects - Reascripts - Lua: Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner Donate via Paypal | LBX Tools Website |
|
Thread Tools | |
Display Modes | |
|
|