Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#10 | Link |
|
Angel of Night
![]() Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,567
|
Add this to your script, top or bottom, or save it to an avsi file in your \avisynth 2.5\plugins folder:
Code:
function makemod(clip c,int "xmod",int "ymod",bool "crop") {
xmod=default(xmod,16)
ymod=default(ymod,xmod)
crop=default(crop,false)
c
ox=width
oy=height
xm=width%xmod
ym=height%ymod
w=c.isrgb32() || c.isrgb24() ? 1 : 2
right=c.crop(ox-w,0,w,0)
right=right.stackhorizontal(right,right,right)
right=xmod>w*4 ? right.stackhorizontal(right,right,right) : right
vx=ox % xmod==0 ? c : stackhorizontal(c,right.crop(0,0,xmod-(ox % xmod),0))
bottom=vx.crop(0,oy-w,0,w)
bottom=bottom.stackvertical(bottom,bottom,bottom)
bottom=ymod>w*4 ? bottom.stackvertical(bottom,bottom,bottom) : bottom
vy=oy % ymod==0 ? vx : stackvertical(vx,bottom.crop(0,0,0,ymod-(oy % ymod)))
cropped = c.crop(0,0,width-xm,height-ym)
return crop == true ? cropped : vy
}
MakeMod(4) It'll mirror the edge pixels so that filters don't munge a huge black border into the image. I used to use it a lot when I did a lot of upscaling & filtering of web images, and it had to be fairly memory efficient. |
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|