07-12-2022, 04:20 PM | #1 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Peephole wipe: x/y axis
I'm displaying a full screen image (JPG) at the end of a video, and I use the peephole wipe to transition from the video to the image, but I'd like to have the "hole", as it's getting smaller, shift over to the left (or right) so that the last thing you focus on is not the center of the video but off to the side (and a little lower than center).
A humorous accentuation you might say. It's possible it's intended to highlight a particular person's backside.... though that would be rude of me... so let's say it's not. Can there be an X/Y coordinate added to Peephole Wipe? |
07-13-2022, 04:10 AM | #2 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
Here is link: Peephole/vignette with ajustable center There are a few videos artifacts if your go to far to the extremes of the screen but that should do it. |
|
07-14-2022, 02:42 PM | #3 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Ah yes.... I recall now... and even see that I had made the 2nd comment on that thread. The mind fades.
Unfortunately the artifacts become quite apparent when I x/y the peephole across the screen as it's being expanded, or it could just be when it interacts with the edge of the screen. Since I'm looking to "present" the video using this it won't work, as it needs to go from size 0 to 2. As it hits the edge it gets noticeable. |
07-14-2022, 03:38 PM | #4 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
Code:
//patch opw=project_w; oph=project_h; npw=project_w*=1.4; nph=project_h*=1.4; gfx_blit(0,0,(npw-opw)/2,(nph-oph)/2,opw,oph); Last edited by papagirafe; 07-14-2022 at 06:13 PM. Reason: new info |
|
07-15-2022, 07:27 AM | #5 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Hi Fuzzball,
I tested the patch concept and it works but there are several more steps to make it work without loosing video quality. I made a demo project to illustrate and as a bonus there is a video track analizer/selector in there... Vignette patch demo.rpp |
07-20-2022, 03:21 PM | #6 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Ok folks,
Here is a more permanent solution to this ajustable vignette position. I did a major rewite and simplification of the stock preset and guess what: no more video artifacts. A major rewrite means potential situations I've overlooked so let me know if there are problems. Code:
//Peephole wipe / vignette v3 // by Papagirafe // major stock code simplification + adjustable vignette position //@param size 'size' 1 0 8 1 0.01 //@param scale 'shaping' 1 .5 10 5.25 0.01 //@param div 'sub-divide' 32 8 256 36 1 //@param fgi 'fg src' 0 0 10 5 1 //@param bgi 'bg src' 1 0 10 5 1 //@param fga 'fg alpha' 1 0 1 0.5 0.01 //@param bga 'bg alpha' 1 0 1 0.5 0.01 //@param xoff "fg x offset" 0 -1 1 0 0.01 //@param yoff "fg y offset" 0 -1 1 0 0.01 function vignette(si,x,y,w,h, size, scale, alpha) local(divw, divh, xp, yp, dx, dy, p, yv,xsc, ysc, xr, yr, mask, sz, adj) global(div,project_w,project_h,colorspace) ( input_info(si,w,h); sz=max(min(w,h)*size*.5,1); adj=-scale/sz; mask = colorspace=='RGBA'?-1:-2; divw = w*.5; while (divw > div) ( divw *= 0.5 ); divw |= 0; divh = h*.5; while (divh > div) ( divh *= 0.5 ); divh |= 0; dx = w / (divw-1); dy = h / (divh-1); xsc = w / project_w; ysc = h / project_h; yp=p=0; loop(divh, xp=0; yr = (yp+0.5)&mask; yv = sqr(yr-h*.5); loop(divw, xr = (xp+0.5)&mask; p[0]=(x + xr)*xsc; p[1] = (y + yr)*ysc; p[2] = alpha * max(min((sqrt(sqr(xr-w*.5)+yv)-sz)*adj,1),0); p += 3; xp += dx; ); yp += dy; ); gfx_xformblit(si,x,y,w,h,divw,divh,0,1); ); //////////////////////////////// !project_wh_valid?( //get a rectangle that can contain both images input_info(fgi,fw,fh); input_info(bgi,fw,fh); project_w=max(fw,bw); project_h=max(fh,bh); ); xoff*=(project_w/2); yoff*=(project_h/2); gfx_set(0,0,0,1,0,-1,0); gfx_blit(bgi,0); bga<1?( gfx_a=1-bga; gfx_blit(fgi,0); ); gfx_a=1; vignette(fgi,xoff,yoff,fsw,fsh,size,scale,fga); Last edited by papagirafe; 07-23-2022 at 04:46 AM. Reason: correcting typo in code |
07-20-2022, 06:41 PM | #7 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
I can't seem to get it to do anything noticeable. I've put it as a video effect on a track which simply displays a JPG as the video thumbnail. I display that over the video and have the peephole open up as the music starts. But no matter what I do to the track settings the JPG displays with no peephole, and the video behind it is never seen.
The Cockos Peephole wipe is on the same track but disabled. When enabled it works fine. No other FX are on the track, and removing the Cockos one had no effect either. |
07-21-2022, 05:44 AM | #8 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
The right conditions to make it work are simple though: - First make sure you set the project's dimensions. - Second add a "Basic helpers: Track opacity/zoom/pan" on each track. That will convert your track to the project's dimension and you can make sure that things are aligned properly. That fix will change the inputs numbers for sure so here is my input stack analyzer. Just put it alone on an empty track on top of all others. That will help you find the right input numbers (minus 1 because the analyser comes after the vignette...) Code:
//input stack analyzer // by papagirafe //@param src src 0 0 100 50 1 //@param 3:opacity 'text opacity' 0.5 0 1 0.5 0.1 function update_param(p*,val)( on_parameter_change(p); p=val; on_parameter_change(p,1);); src=((src+0.5)|0); src>=(ic=input_count())?update_param(src,ic-1); input_info(src,w,h); gfx_set(0,0,0,1); gfx_fillrect(0,0,w,h); gfx_blit(src,1); gfx_setfont(min(project_h,project_w)*0.07); w&&h?input_get_name(src,#iname):#iname="no track"; sprintf(#debug,"[%d]:(%dx%d) %s",src,w,h,#iname); gfx_str_measure(#debug,tw,th); gfx_set(0,0,0,opacity,0,-1,0); gfx_fillrect(0,0,tw,th); gfx_set(1,1,1,opacity,0,-1,0); gfx_str_draw(#debug,0,0); Last edited by papagirafe; 07-28-2022 at 04:24 AM. |
|
07-31-2022, 05:02 PM | #9 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Hiho!
I finally put aside some time to correct the misbehavior when sources sizes don't match. You are no longer obliged to add size correcting presets on the sources. I am cooking up a much better version of this "vignette" in the upcoming GiraFX library. In the mean time, here is the fixed version (v3.01): Code:
//Peephole wipe / vignette v3.01 // by Papagirafe // 3.0 major stock code simplification + adjustable vignette position // 3.01 source size mismatch behavior fixed //@param size 'size' 1 0 8 1 0.01 //@param scale 'shaping' 1 .5 10 5.25 0.01 //@param div 'sub-divide' 32 8 256 36 1 //@param fgi 'fg src' 0 0 10 5 1 //@param bgi 'bg src' 1 0 10 5 1 //@param fga 'fg alpha' 1 0 1 0.5 0.01 //@param bga 'bg alpha' 1 0 1 0.5 0.01 //@param xoff "fg x offset" 0 -1 1 0 0.01 //@param yoff "fg y offset" 0 -1 1 0 0.01 function vignette(si,x,y,w,h, size, scale, alpha) local(divw, divh, xp, yp, dx, dy, p, yv,xsc, ysc, xr, yr, mask, sz, adj) global(div,project_w,project_h,colorspace) ( sz=max(min(w,h)*size*.5,1); adj=-scale/sz; mask = colorspace=='RGBA'?-1:-2; divw = w*.5; while (divw > div) ( divw *= 0.5 ); divw |= 0; divh = h*.5; while (divh > div) ( divh *= 0.5 ); divh |= 0; dx = w / (divw-1); dy = h / (divh-1); xsc = w / project_w; ysc = h / project_h; yp=p=0; loop(divh, xp=0; yr = (yp+0.5)&mask; yv = sqr(yr-h*.5); loop(divw, xr = (xp+0.5)&mask; p[0]=(x + xr)*xsc; p[1] = (y + yr)*ysc; p[2] = alpha * max(min((sqrt(sqr(xr-w*.5)+yv)-sz)*adj,1),0); p += 3; xp += dx; ); yp += dy; ); gfx_xformblit(si,x,y,w,h,divw,divh,0,1); ); //////////////////////////////// !project_wh_valid?(project_w=1280;project_h=720); gfx_set(0,0,0,1,0,-1,0); fgi2=gfx_img_alloc(project_w,project_h); gfx_dest=fgi2; gfx_blit(fgi,1); gfx_dest=-1; gfx_blit(bgi,1); bga<1?( gfx_a=1-bga; gfx_blit(fgi,1); ); vw=max(min(fgw,fgh)*size*.5,1); xoff*=project_w/2; yoff*=project_h/2; gfx_a=1; vignette(fgi2,xoff,yoff,project_w,project_h,size,scale,fga); gfx_img_free(fgi2); |
08-04-2022, 04:17 PM | #10 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
An interesting thing happens with this vignette when you use an envelope to open and close the peephole.
1) Stretch an image out across the timeline. 2) Add Peephole Wipe v3.01. 3) Click on the size parameter and then show it on track envelope. 4) Put two points on the track envelope and then drag one of them to the top or bottom to create a "slope." Results: The slope is not uniform like you would expect. It develops a sharp angle when it crosses the center line. The bottom half of the envelope is 0-1 and the top half is 1-8. Is this the intended behavior? |
08-04-2022, 06:32 PM | #11 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
|
|
08-04-2022, 06:38 PM | #12 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
I had already tried that but then it goes slow for the first half (which is 0-1, and then speeds up for the 2nd half, which is 1-8. An 8-1 ratio of speed in the 1st half vs 2nd half.
The issue didn't start in this version. It was a while back. I assumed you had a good reason why the size parameter goes from 0-8 instead of 0-2 like the Cockos version does. |
08-05-2022, 04:00 AM | #13 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
|
|
08-05-2022, 06:54 AM | #14 |
Human being with feelings
Join Date: Oct 2014
Posts: 1,369
|
so..
i have another way to get around with moving vignettes, using leafac's way to deal with masking using black and white pictures. in the second track is a picture of a vignette , black and white setting contrast an brightness with the usual videoprozessor (Track opacity) to set the edges and transitions and the position with the usual videoproc (Brightness/contrast...) and some key-animation-stuff on appropriate parameters above is a picture (a video will do here too) with the mascing videoprocessor on it, taking the next video as mask For demo purposes and for fun i made a templateproject. and here is the rendered result as video (no tone) 1920 1200 and no, it's not me holding the hose into the wind i'm looking forward to the GiraFX-Stuff Last edited by bobobo; 08-05-2022 at 10:57 PM. |
08-05-2022, 11:31 AM | #15 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Hi Folks,
I was waiting for some input in my current project, so I was able to prepare the new pre-release Peephole/Vignette preset. First, to duplicate the original functionality (and improve on it) it now consists of 2 presets: 1) a pure Vignette transparency preset to apply to your foreground source 2) an improved version of "Image overlay" that can select fg/bg source and more The vignette efficiently delivers better image quality, smoother transparency gradient and easier to understand parameters. The "crop to vignette" acts like a cropping/framing tool. Take note that without the image overlay, this preset seems to do nothing but in fact it create a vignette exclusively in the alpha plane. The newer "Image overlay" is adding bg/fg source control on my already improved version I released in July. There is a special "toggle" parameter in there that, when set, will recalculate the fg/bg inputs to standard values. This parameter returns to 0 by itslef. Last but not least, the "zoom mode" param allows to automatically set the zoom to maximize width or height of the fg source. *** 2022-08-09: added flag for single processing *** *****Peephole/vignette ******* Code:
//girafx:peephole/vignette // by papagirafe // v1.0/2002.08.05: initial release // v1.01/2002.08.06: added "invert mask" feature // *** warning: transparency only filter, requires "image overlay" //@param radius radius 1 0 4 2 0.01 //@param grw "gradient width" 0.5 0 1 0.5 0.001 //@param xoff xoff 0 -1 1 0 0.01 //@param yoff yoff 0 -1 1 0 0.01 //@param c2v "crop to vignette" 0 0 1 0.5 1 //@param im "invert mask" 0 0 1 0.5 1 input_info(0,w,h)?( colorspace='RGBA'; #code[0]=" rad=sqrt((x-cx)^2+(y-cy)^2); rad>pr?a=0:rad>=pr2?a=255*(pr-rad)/(pr-pr2):a=255; x+=1;x==vw?(y+=1;x=0); "; #code[1]=" rad=sqrt((x-cx)^2+(y-cy)^2); rad>pr?a=255:rad>=pr2?a=255-(255*(pr-rad))/(pr-pr2):a=0; x+=1;x==vw?(y+=1;x=0); "; x=y=0; pr=(radius*min(w,h)/2)|0; pr2=max(0,(1-grw)*pr)|0; c2v?(cx=cy=pr;sx=(1+xoff)*w/2-pr;sy=(1+yoff)*h/2-pr;vw=vh=project_w=project_h=2*pr): (cx=(1+xoff)*w/2;cy=(1+yoff)*h/2;sx=sy=0;vw=project_w=w;vh=project_h=h); gfx_blit(0,0, 0,0,vw,vh, sx,sy,vw,vh); gfx_evalrect(0,0,vw,vh,#code[im],1); ); Code:
//Image overlay w/rot/auto-zoom/src ctl // by papagirafe //v1.1 added rotation //v1.21 added video source control & fg auto-zoom //@param opacity 'opacity' 1 //@param zmode "zoom mode" 0 0 2 1 1 0=manual, 1=maximize height, 2=maximize width //@param zoom 'zoom' 0 -15 15 0 0.01 //@param xoffs 'X offset' 0 -1 1 0 0.01 //@param yoffs 'Y offset' 0 -1 1 0 0.01 //@param rota "rotation" 0 -360 360 0 0.1 //@param cxoff 'rot axis x offset' 0 -1 1 0 0.01 //@param cyoff 'rot axis y offset' 0 -1 1 0 0.01 //@param10:fg "fg input" 0 0 40 20 1 //@param bg "bg input" 1 0 40 20 1 //@param reset "auto inputs values" 0 0 1 0.5 1 //@paramfilter 'filter' 0 0 1 0.5 1 //@param use_srca 'alpha channel' 1 0 1 0.5 1 function refresh_param(p*,val)(on_parameter_change(p);p=val; on_parameter_change(p,1)); function set_origin(ox,oy)(this.ox=ox;this.oy=oy); function rotate_coord(x,y,rota) instance(r,phi) ( this.x=x-this.ox; this.y=y-this.oy; r=sqrt(this.x^2+this.y^2); phi=2*atan(this.y/(this.x+r))+rota; this.x=r*cos(phi); this.y=r*sin(phi); ); function calc_extra_rot(w,h,rota,ox,oy) local(a,rx,ry,rxmax,rymax,ox,oy) ( rxmax=rymax=0; rx=w>>1; ry=h>>1; ox=(ox*w)|0; oy=(oy*h)|0; a.set_origin(rx,ry); a.rotate_coord(0+ox,0+oy,rota); abs(a.x)>rxmax?rxmax=abs(a.x|0); abs(a.y)>rymax?rymax=abs(a.y|0); a.rotate_coord(w+ox,0+oy,rota); abs(a.x)>rxmax?rxmax=abs(a.x|0); abs(a.y)>rymax?rymax=abs(a.y|0); a.rotate_coord(0+ox,h+oy,rota); abs(a.x)>rxmax?rxmax=abs(a.x|0); abs(a.y)>rymax?rymax=abs(a.y|0); a.rotate_coord(w+ox,h+oy,rota); abs(a.x)>rxmax?rxmax=abs(a.x|0); abs(a.y)>rymax?rymax=abs(a.y|0); max(rxmax/rx,rymax/ry); ); ic=input_count(); reset==1?(refresh_param(fg,0);refresh_param(bg,input_track(0));refresh_param(reset,0)); use_srca && fg != bg ? colorspace='RGBA'; input_info(bg,img1w,img1h) && project_wh_valid===0 ? ( project_w = img1w; project_h = img1h; ); a = opacity < 0.01 ? 0 : opacity > 0.99 ? 1 : opacity; fg != bg && input_info(fg,sw,sh) ? ( gfx_blit(bg,0); a>0?( gfx_a=a; gfx_mode = (filter>0.5 ? 256 : 0)|(use_srca?0x10000:0); rota*=$pi/180; zmode==1?refresh_param(zoom,10*log10(z=project_h/sh)): zmode==2?refresh_param(zoom,10*log10(z=project_w/sw)): z=10^(zoom/10); dw = (sw*z)|0; dh = (sh*z)|0; x = (project_w - dw + (project_w + dw)*xoffs)*.5; y = (project_h - dh + (project_h + dh)*yoffs)*.5; sc=calc_extra_rot(dw,dh,rota,cxoff,cyoff); sc2=sc*.5 - 0.5; gfx_rotoblit(fg,rota,(x-dw*sc2)|0,(y-dh*sc2)|0,dw*sc,dh*sc, -sw*sc2, -sh*sc2, sw*sc, sh*sc,0,(cxoff*dw)|0,(cyoff*dh)|0); ); ); Last edited by papagirafe; 08-09-2022 at 06:15 AM. Reason: bug correction, added flag to prevent multi-processing. |
08-05-2022, 02:22 PM | #16 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
If I wanted to take these two scripts, and replace the one script "Peephole wipe / vignette" - can you describe to me the steps?
With "Peephole wipe / vignette" I put it as the only script on the foreground image and open a hole using the Size parameter (after reversing inside input and outside input). |
08-05-2022, 02:39 PM | #17 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
Bottom track: background image/video (+optionaly fx=resize to project dim) Top track: foreground image/video 1 "new vignette fx" 2 "new image overlay fx" with zoom mode set to 1 or 2 and then set "auto input values" Your image should appear, go back to vignette to adjust size/pos/gradient |
|
08-05-2022, 02:55 PM | #18 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Can you tell me how to do it so that the foreground image opens up with a hole in the center to reveal the background image?
Currently when you reveal the background image it's because the foreground image shrinks in from the edge. I tried fiddling with the fg input and bg input on the overlay, but I end up feeling like a doofus when I can't get it to work. On the original Peephole/wipe there's a Inside Input and Outside Input to swap those. |
08-05-2022, 04:27 PM | #19 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
|
|
08-05-2022, 11:01 PM | #20 |
Human being with feelings
Join Date: Oct 2014
Posts: 1,369
|
hi papa
i tested your new scripts and it looks weird here in editor .. but it works in the second track is the background item playing around with the params i get a vignette (the item of the first track "vignetted" over the background. BUT if i animate the params things goes crazy. it seams to take some rounds to get things right. the result of the chages take some time (and sometimes repetitions) to chime in.. crazy BUT rendered output seams to be ok that shows that the videoprocessor has something to do.. i made a demo and here is a rendered video and i changed the link in my posting above concerning the demo project. now it's the correct demo. Last edited by bobobo; 08-06-2022 at 03:24 AM. |
08-06-2022, 05:16 AM | #21 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
Fuzzball: I added an "invert mask" on the vignette that should restore the behavior you are use to. I updated the code on my publication from yesterday |
|
08-06-2022, 04:20 PM | #22 | |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Quote:
The only thing I dare suggest would be to make the Peephole independent of the Image Overlay (so you just need the one FX). |
|
08-06-2022, 06:45 PM | #23 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
|
|
08-07-2022, 11:36 AM | #24 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
I'm starting to see the reason behind you originally setting the Radius to go up to 8. I've noticed that if I have the Radius at the new maximum of 4 and increase the Gradient Width to more than the default of .5, it starts to impinge on the corners/edge of the project.
As it is now I'll use the required image overlay to make the foreground image invisible during the actual video, and transition it to visible before shrinking the hole down. I'm going to try to soon post an example of the video transition I'm working on. Just rendering the last 30 or so seconds, since it renders at 0.1% speed now. |
08-07-2022, 12:05 PM | #25 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Here's an example of what I'm trying to do. It's rough yet, but I think shows off the FX well.
Using two images in the foreground and one video behind them. The first image in the chain is the white thumbnail, the 2nd is a deep dark blue starfield, and the 3rd is the video, which in this case has no actual connection to the music... it's just a video I threw in to have something there. The audio will go away also to be replaced by my rendition. This is literally just a proof of concept. The white thumbnail image and the blue starfield image both begin closing the hole in the radius at the same time, but the blue starfield is using a larger gradient width, so it looks more like a blue iris full of stars. https://www.youtube.com/watch?v=a-V95asOiPQ I have a nice little green screen star twinkle somewhere around here and I'll put it right at the spot where everything disappears. Should look nice. |
08-07-2022, 02:24 PM | #26 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
As for the limits I put for the parameters, if needed you can safely increase the one for radius and the precision for gradient wihtout additional impact on performance. |
|
08-09-2022, 04:00 PM | #27 | |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Quote:
End result is amazing, though very CPU intensive. It takes my i5 laptop close to 30 minutes to render a 3 minute video. Now that I know why you had the radius at 8 I see that it's useful, as long as the automation "slope" doesn't get weird like it was before. As far as how to make that change, I'm not versed in the language. I'm a MSSSQL guy. |
|
08-09-2022, 05:58 PM | #28 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
Performance wise, the toll on the CPU really bugged me so I went back and decided to see if I could translate the evalrect() code into a tranform matrix to feed xformblit()...and the answer is yes! I tried it: the quality is almost the same and it now works in real time!!! I made a quick (but unflexible) preset that restores most of the original vignette functionality and ... tada! ... it also allows ellipses! BTW as you wished, it's a single preset but the sources might be reversed from what you are used to. Here is the new code to test: Code:
//girafx:elliptical vignette xfb // by papagirafe // v0.9 //@param radius radius 1 0 4 2 0.01 //@param df "focal dist" 0 0 2 1 0.001 //@param thickness "thickness" 0.1 0 1 0.5 0.001 //@param rota rotation 0 -90 90 0 1 //@param xoff xoff 0 -1 1 1 0.01 //@param yoff yoff 0 -1 1 1 0.01 //@param hdivs precision 100 32 196 96 4 input_info(0,w,h)?( colorspace='RGBA'; project_w=w; project_h=h; rota=rota*$pi/180; df*=min(w,h)/2; cx=(1+xoff)*w/2; cy=(1+yoff)*h/2; f1x=cx+cos(rota-$pi)*df; f1y=cy+sin(rota-$pi)*df; f2x=cx+cos(rota)*df; f2y=cy+sin(rota)*df; pr=ceil(radius*min(w,h)); pr2=max(0,(1-thickness)*pr); xtcorr=1.0069; //border effect compensation factor tx=0;ty=1;ta=2; vdivs=(h/w*hdivs)|0; incrx=w/hdivs*xtcorr; incry=h/vdivs*xtcorr; i=0;x=0;y=0; loop(vdivs, loop(hdivs, rad=sqrt((x-f1x)^2+(y-f1y)^2) + sqrt((x-f2x)^2+(y-f2y)^2); xt[i+tx]=x; xt[i+ty]=y; xt[i+ta]=rad>pr?0:rad>=pr2?1*(pr-rad)/(pr-pr2):1; i+=3; x+=incrx; ); y+=incry; x=0; ); gfx_blit(input_track()); gfx_xformblit(0, 0,0,w,h, hdivs,vdivs,xt,1); ); |
|
08-11-2022, 05:47 PM | #29 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
Is there a relatively easy way to reverse the source order? The project I'm working on now has a lot of work invested in the order in which the images and videos stack up.
There is a 1920x1080 image on the top of the stack through which I want to "poke a hole". Behind that are multiple videos superimposed upon each other using horizontal wipe and various effects. So I can't put the effect on the background images because there are more than one of them showing at one time. It needs to go on the foreground. |
08-12-2022, 04:26 AM | #30 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
Code:
//girafx:elliptical vignette xfb // by papagirafe // v0.9 //@param radius radius 1 0 4 2 0.01 //@param df "focal dist" 0 0 2 1 0.001 //@param thickness "thickness" 0.1 0 1 0.5 0.001 //@param rota rotation 0 -90 90 0 1 //@param xoff xoff 0 -1 1 1 0.01 //@param yoff yoff 0 -1 1 1 0.01 //@param hdivs precision 100 32 196 96 4 //@param hsrc "hole src" 1 0 20 10 1 //@param psrc "pierced src" 0 0 20 10 1 input_info(hsrc,w,h)?( colorspace='RGBA'; project_w=w; project_h=h; rota=rota*$pi/180; df*=min(w,h)/2; cx=(1+xoff)*w/2; cy=(1+yoff)*h/2; f1x=cx+cos(rota-$pi)*df; f1y=cy+sin(rota-$pi)*df; f2x=cx+cos(rota)*df; f2y=cy+sin(rota)*df; pr=ceil(radius*min(w,h)); pr2=max(0,(1-thickness)*pr); xtcorr=1.0069; //border effect compensation factor tx=0;ty=1;ta=2; vdivs=(h/w*hdivs)|0; incrx=w/hdivs*xtcorr; incry=h/vdivs*xtcorr; i=0;x=0;y=0; loop(vdivs, loop(hdivs, rad=sqrt((x-f1x)^2+(y-f1y)^2) + sqrt((x-f2x)^2+(y-f2y)^2); xt[i+tx]=x; xt[i+ty]=y; xt[i+ta]=rad>pr?0:rad>=pr2?1*(pr-rad)/(pr-pr2):1; i+=3; x+=incrx; ); y+=incry; x=0; ); gfx_blit(psrc); gfx_xformblit(hsrc, 0,0,w,h, hdivs,vdivs,xt,1); ); |
|
11-08-2022, 09:56 AM | #32 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 690
|
Quote:
|
|
11-08-2022, 09:58 AM | #33 | |
Human being with feelings
Join Date: May 2010
Location: Norway
Posts: 7,318
|
Quote:
|
|
Thread Tools | |
Display Modes | |
|
|