Movie Effect: Sprint Ahead
Have you seen the commercials for Sprint where people make figures with light in the air?
http://www.sprint.com/ahead
Here's a saved bit of one of them: sprintcommercial.mov
At Dan Garcia's encouragement, I tried to duplicate it in JES. (Anyone want to do a Java version?)
Here's the basic algorithm:
- First, film somebody moving a light, and burst the frames to JPEGs. We did it in the dark to make sure that we could get the light. It's clear that it doesn't have to be that dark – dusk or even indoors would probably work.
- Grab the first frame as the "fromPict"
- For all frames "toPict" from the second on,
- For every high luminance pixel in fromPict, copy the color to the same X, Y in toPict
- Save out the toPict frame
- Rename the toPict as fromPict.
Here's the .py file: dragTrace.py
And here's the code:
import os
def dragTrace(fromDir,target,level):
allFiles = os.listdir(fromDir)
allFiles.sort()
fromPictFile = allFiles[0]
fromPict = makePicture(fromDir+fromPictFile)
for toPictFile in allFiles[1:]:
printNow(toPictFile)
# Copy all the high luminance colors from fromPict to toPict
toPict = makePicture(fromDir+toPictFile)
for p in getPixels(fromPict):
if luminance(p) > level:
c = getColor(p)
setColor(getPixel(toPict,getX(p),getY(p)),c)
writePictureTo(toPict,target+toPictFile)
fromPict = toPict
def luminance(apixel):
return (getRed(apixel)+getGreen(apixel)+getBlue(apixel))/3.0
#In one method, because they take a LONG time
def dopaints():
dragTrace("/home/guzdial/cs1315/moviepainting/paint1-20fps/","/home/guzdial/cs1315/moviepainting/paint1-paint/",100)
dragTrace("/home/guzdial/cs1315/moviepainting/paint2-10fps/","/home/guzdial/cs1315/moviepainting/paint2-paint/",100)
dragTrace("/home/guzdial/cs1315/moviepainting/paint3/","/home/guzdial/cs1315/moviepainting/paint3-paint/",100)
dragTrace("/home/guzdial/cs1315/moviepainting/paint4/","/home/guzdial/cs1315/moviepainting/paint4-paint/",100)
dragTrace("/home/guzdial/cs1315/moviepainting/paint5/","/home/guzdial/cs1315/moviepainting/paint5-paint/",100)
dragTrace("/home/guzdial/cs1315/moviepainting/paint6/","/home/guzdial/cs1315/moviepainting/paint6-paint/",100)
Examples
Here's the first try, with a glow stick: paint1.avi
Here are the burst frames, if you want to play: paint1-20fps.zip
Here's the generated movie: paint1.mpg
Last frame:
We found that using a flashlight worked even better (but don't shine directly at the camera!)
Movie: paint4.avi
First frame:
Burst frames: paint4.zip
Here's the result: paint4.mpg
Last frame:
More examples (all with a glow stick)
Links to this Page