Old 07-14-2023, 12:24 PM   #1
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default Vignette with Blur

Does anyone know how to modify the blur presets or the vignette preset so that the center of the video is clear, but the edges are blurry?

I've seen a solution where two tracks with identical videos are used: one track has the blur, and the other has the vignette.

Ideally, I would like to achieve the same effect with one track.
pcartwright is offline   Reply With Quote
Old 07-15-2023, 07:46 AM   #2
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 690
Default

Quote:
Originally Posted by pcartwright View Post
Does anyone know how to modify the blur presets or the vignette preset so that the center of the video is clear, but the edges are blurry?

I've seen a solution where two tracks with identical videos are used: one track has the blur, and the other has the vignette.

Ideally, I would like to achieve the same effect with one track.
Yes I know how and you can start from the vignette code I published a while ago. I don't have time to modify it (leaving for vacation...) but the idea is to change the math for the transition formula in one line of code. Currently my code uses a linear formula. Here is the code and a comment on where to change:
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);

  tx=0;ty=1;ta=2; 
  vdivs=(h/w*hdivs)|0;
  incrx=w/(hdivs-1);
  incry=h/(vdivs-1);
  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):  //*** change the formula here ****
          1;
      i+=3;
      x+=incrx; 
    );
    y+=incry;
    x=0; 
  );
  gfx_blit(psrc);
  gfx_xformblit(hsrc, 0,0,w,h, hdivs,vdivs,xt,1);
);
papagirafe is offline   Reply With Quote
Old 07-15-2023, 11:32 AM   #3
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 690
Default

Quote:
Originally Posted by pcartwright View Post
Does anyone know how to modify the blur presets or the vignette preset so that the center of the video is clear, but the edges are blurry?

I've seen a solution where two tracks with identical videos are used: one track has the blur, and the other has the vignette.

Ideally, I would like to achieve the same effect with one track.
Probbably read your message too rapidly. Can you provide a visual example? I'm not sure what you are looking for.
papagirafe is offline   Reply With Quote
Old 07-18-2023, 02:39 PM   #4
pcartwright
Human being with feelings
 
Join Date: Jan 2009
Posts: 1,030
Default

Your code gets very close to what I'm looking for. Thanks!

Here is an example from Photoshop of what I'm going for:
https://photoshoproadmap.com/wp-cont...r-gallery1.jpg

Your script is a swipe effect, and I am just trying to effect the current track and not swipe to another video track. I don't want any video content from other lanes to be visible.
pcartwright is offline   Reply With Quote
Old 07-18-2023, 06:29 PM   #5
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 690
Default

Quote:
Originally Posted by pcartwright View Post
Your code gets very close to what I'm looking for. Thanks!

Here is an example from Photoshop of what I'm going for:
https://photoshoproadmap.com/wp-cont...r-gallery1.jpg

Your script is a swipe effect, and I am just trying to effect the current track and not swipe to another video track. I don't want any video content from other lanes to be visible.
It seems that you are better off with my template preset that create polygons and circles:
https://forum.cockos.com/showthread.php?p=2596391
papagirafe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.