Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

MagicPrisma

Also seen in "trendy" MTV-interviews back in the 90ies ;-)

# get some colourful video clip here ;-)
d = AviSource("bindiya chamke, choodi khanke.avi")

# for width = multiple of 8 and not less than 8
function rand4(int max) {
	x = rand(floor(max/8))*8
	return (x>8) ? x : 8
}

# create Effect
function randomLayer(clip c, clip src) {
	width = width(src)
	height = height(src)
	w0 = rand4(width-50)
	h0 = rand4(height-50)
	w1 = rand4(width-50)
	h1 = rand4(height-50)
	xSrc = rand(width-w1)
	ySrc = rand(height-h1)
	tile = c.bilinearresize(w0,h0, xSrc,ySrc,w1,h1)
	xDst = rand(width-w0)
	yDst = rand(height-h0)
	return select(rand(4), c.layer(tile,"subtract",127,xDst,yDst), c.layer(tile,"add",127,xDst,yDst), c.layer(tile,"lighten",255,xDst,yDst,127), c.layer(tile,"darken",255,xDst,yDst,127))
}

# double the effect
function doubleLayer(clip c) {
	return c.randomLayer(c).randomLayer(c)
}

# return multiple layered effects
return d.doubleLayer.doubleLayer.doubleLayer.doubleLayer

SourceForge Logo

 


Edit this document | View document history
Document last modified Tue, 10 Jun 2003 19:11:14