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