View Full Version : Duplicating edges
Soulvomit
19th September 2012, 21:16
How would I go about repeating the first row of pixels from any side of a video?
Didée
19th September 2012, 21:55
To the outside (making framesize bigger), or to the inside?
Repeating to the outside is very easy. It's also called "padding".
PointResize( width()+8, height()+8, -4,-4, width()+8, height()+8 ) # padding 4 pixels on every side
Reflecting to the inside is more tricky, and raises some "how do you want it to be" questions. It will be either some fiddling with crop() and StackHorizontal/Vertical, and/or involve some sort of masked-merging.
mandarinka
20th September 2012, 00:51
There are also filters like addborders() which adds black bars and fillmargins() which can fill them with the border lines/columns of the actual image.
Soulvomit
21st October 2012, 11:15
Thanks a lot, Didée and mandarinka. Yeah, I was referring to making the frame bigger. Using PointResize, is it possible to choose which side I want to work with or is padding every one of them and cropping thereafter inevitable?
Didée
21st October 2012, 11:35
function Padding(clip c, int left, int top, int right, int bottom)
{
w = c.width()
h = c.height()
c.pointresize( w+left+right, h+top+bottom, -left, -top, w+left+right, h+top+bottom )
}
Padding only the right border, by 8 pixels:
yourclip.Padding(0,0,8,0)
Soulvomit
21st October 2012, 11:47
Many thanks. :D
color
11th March 2018, 20:23
Thank you for the script Didée, I know this is an old post but it helped me with some problems I had. :D
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.