The effect I was going for is that I have Hiro Protagonist ,from the novel Snowcrash, entering the storage shed to practice with his samurai sword online. He has goggles that he puts on and this enters him into his online space in the dojo. So he enters the storage, puts on the goggles and his background changes as the dojo is loading into his goggles; next his new appearance begins loading and finishes, leaving him with a sword and ninja outfit; finally the dojo finishes loading up and fully appears. After this he begins practicing.
To achieve this effect I created two different masked images and masked them together with a separate mask. First I masked out the backgrounds to put the subject in the two different places. Next I took the moment the backgrounds were transitioning and created a mask for the foreground, so only the subject would be masked but the background would not.
The effect still needs some polishing and I believe the fault is that lighting for this effect should be more consistent for the right amount of color to be removed. I faced certain time constraints for my filming schedule but I will continue to work on this effect as I feel it has the possibility to turn out quite cool.
Here's the Code I used for the Final Project:
#!/bin/bash
# extract images from Original video files
echo "Extracting Images"
FILES=./*.avi
b=1
for i in $FILES
do
mkdir images$b
ffmpeg -i MaskTest$b.avi -f image2 images$b/%d.ppm
let b=$b+1
done
echo "Importing Backgrounds"
FILES=images4/*.ppm
b=1
mkdir EnterStorage
mkdir EnterStorage/Converted
mkdir EnterStorage/Comp
for i in $FILES
do
ppmchange -closeness=28 blue red images4/$b.ppm >EnterStorage/Converted/RED$b.ppm
ppmcolormask -color red EnterStorage/Converted/RED$b.ppm >EnterStorage/Converted/REDMASK$b.pbm
pamcomp background1/storage.ppm EnterStorage/Converted/RED$b.ppm -alpha=EnterStorage/Converted/REDMASK$b.pbm -
invert >EnterStorage/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images5/*.ppm
b=1
mkdir StraightenGoggles
mkdir StraightenGoggles/Converted
mkdir StraightenGoggles/Comp
for i in $FILES
do
ppmchange -closeness=42 blue red images5/$b.ppm >StraightenGoggles/Converted/RED$b.ppm
ppmcolormask -color red StraightenGoggles/Converted/RED$b.ppm >StraightenGoggles/Converted/REDMASK$b.pbm
pamcomp background1/storagecloseup.ppm StraightenGoggles/Converted/RED$b.ppm -
alpha=StraightenGoggles/Converted/REDMASK$b.pbm -invert >StraightenGoggles/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images6/*.ppm
b=1
mkdir Akimbo
mkdir Akimbo/Converted
mkdir Akimbo/Comp
for i in $FILES
do
ppmchange -closeness=42 blue red images6/$b.ppm >Akimbo/Converted/RED$b.ppm
ppmcolormask -color red Akimbo/Converted/RED$b.ppm >Akimbo/Converted/REDMASK$b.pbm
pamcomp background1/storagemediumshot.ppm Akimbo/Converted/RED$b.ppm -alpha=Akimbo/Converted/REDMASK$b.pbm -
invert >Akimbo/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images7/*.ppm
b=1
mkdir Akimbo2
mkdir Akimbo2/Converted
mkdir Akimbo2/Comp
for i in $FILES
do
ppmchange -closeness=31 blue red images7/$b.ppm >Akimbo2/Converted/RED$b.ppm
ppmcolormask -color red Akimbo2/Converted/RED$b.ppm >Akimbo2/Converted/REDMASK$b.pbm
pamcomp background1/storagemedium2.ppm Akimbo2/Converted/RED$b.ppm -alpha=Akimbo2/Converted/REDMASK$b.pbm -
invert >Akimbo2/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images9/*.ppm
b=1
mkdir NinjaSword
mkdir NinjaSword/Converted
mkdir NinjaSword/Comp
for i in $FILES
do
ppmchange -closeness=37 blue red images9/$b.ppm >NinjaSword/Converted/RED$b.ppm
ppmcolormask -color red NinjaSword/Converted/RED$b.ppm >NinjaSword/Converted/REDMASK$b.pbm
pamcomp background2/dojo.ppm NinjaSword/Converted/RED$b.ppm -alpha=NinjaSword/Converted/REDMASK$b.pbm -invert
>NinjaSword/Comp/Comp$b.ppm
let b=$b+1
done
#Creating Masked Backgrounds
echo "Creating Masked Backgrounds"
FILES=images2a/*.ppm
b=1
mkdir StorageToDojoBackground
mkdir StorageToDojoBackground/Converted
mkdir StorageToDojoBackground/Comp
for i in $FILES
do
ppmchange -closeness=37 blue red images2a/$b.ppm >StorageToDojoBackground/Converted/RED$b.ppm
ppmcolormask -color red StorageToDojoBackground/Converted/RED$b.ppm
>StorageToDojoBackground/Converted/REDMASK$b.pbm
pamcomp background2/dojo.ppm background1/storagemedium2.ppm -
alpha=StorageToDojoBackground/Converted/REDMASK$b.pbm -invert >StorageToDojoBackground/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images2b/*.ppm
b=1
mkdir StorageToDojoBackground2
mkdir StorageToDojoBackground2/Converted
mkdir StorageToDojoBackground2/Comp
for i in $FILES
do
ppmchange -closeness=37 blue red images2b/$b.ppm >StorageToDojoBackground2/Converted/RED$b.ppm
ppmcolormask -color red StorageToDojoBackground2/Converted/RED$b.ppm
>StorageToDojoBackground/Converted/REDMASK$b.pbm
pamcomp background1/storagemedium2.ppm background2/dojo.ppm -
alpha=StorageToDojoBackground/Converted/REDMASK$b.pbm -invert >StorageToDojoBackground2/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images11/*.ppm
b=1
mkdir End
mkdir End/Converted
mkdir End/Comp
for i in $FILES
do
ppmchange -closeness=26 blue red images11/$b.ppm >End/Converted/RED$b.ppm
ppmcolormask -color red End/Converted/RED$b.ppm >End/Converted/REDMASK$b.pbm
pamcomp background2/Dojocloseup.ppm End/Converted/RED$b.ppm -alpha=End/Converted/REDMASK$b.pbm -invert
>End/Comp/Comp$b.ppm
let b=$b+1
done
#Inputting Masked Backgrounds
echo "Inputting Masked Backgrounds"
FILES=StorageToDojoBackground/Comp/*.ppm
b=1
mkdir StorageToDojoComp
for i in $FILES
do
pamcomp StorageToDojoBackground/Comp/Comp$b.ppm Akimbo2/Converted/RED53.ppm -
alpha=Akimbo2/Converted/REDMASK53.pbm -invert >StorageToDojoComp/Comp$b.ppm
let b=$b+1
done
FILES=StorageToDojoBackground2/Comp/*.ppm
b=1
for i in $FILES
do
pamcomp StorageToDojoBackground2/Comp/Comp$b.ppm NinjaSword/Converted/RED$b.ppm -
alpha=NinjaSword/Converted/REDMASK$b.pbm -invert >NinjaSword/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images8a/*.ppm
b=1
mkdir WardrobeChange
mkdir WardrobeChange/Converted
mkdir WardrobeChange/Comp
for i in $FILES
do
ppmchange -closeness=37 blue red images8a/$b.ppm >WardrobeChange/Converted/RED$b.ppm
ppmcolormask -color red WardrobeChange/Converted/RED$b.ppm >WardrobeChange/Converted/REDMASK$b.pbm
pamcomp StorageToDojoComp/Comp61.ppm NinjaSword/Comp/Comp1.ppm -alpha=WardrobeChange/Converted/REDMASK$b.pbm
>WardrobeChange/Comp/Comp$b.ppm
let b=$b+1
done
FILES=images8b/*.ppm
b=1
mkdir WardrobeChange2
mkdir WardrobeChange2/Converted
mkdir WardrobeChange2/Comp
for i in $FILES
do
ppmchange -closeness=37 blue red images8b/$b.ppm >WardrobeChange2/Converted/RED$b.ppm
ppmcolormask -color red WardrobeChange2/Converted/RED$b.ppm >WardrobeChange2/Converted/REDMASK$b.pbm
pamcomp NinjaSword/Comp/Comp1.ppm StorageToDojoComp/Comp61.ppm -alpha=WardrobeChange2/Converted/REDMASK$b.pbm
-invert >WardrobeChange2/Comp/Comp$b.ppm
let b=$b+1
done
#Compiling avi Videos
echo "Compiling Avi Files"
ffmpeg -f image2 -i EnterStorage/Comp/Comp%d.ppm 1.avi
ffmpeg -f image2 -i StraightenGoggles/Comp/Comp%d.ppm 2.avi
ffmpeg -f image2 -i Akimbo/Comp/Comp%d.ppm 3.avi
ffmpeg -f image2 -i Akimbo2/Comp/Comp%d.ppm 4.avi
ffmpeg -f image2 -i StorageToDojoComp/Comp%d.ppm 5.avi
ffmpeg -f image2 -i WardrobeChange/Comp/Comp%d.ppm 6.avi
ffmpeg -f image2 -i WardrobeChange2/Comp/Comp%d.ppm 7.avi
ffmpeg -f image2 -i NinjaSword/Comp/Comp%d.ppm 8.avi
ffmpeg -f image2 -i End/Comp/Comp%d.ppm 9.avi
#Creating Video
echo "Creating Final Video"
ffmpeg -i 1.avi -sameq intermediate1.mpg
ffmpeg -i 2.avi -sameq intermediate2.mpg
ffmpeg -i 3.avi -sameq intermediate3.mpg
ffmpeg -i 4.avi -sameq intermediate4.mpg
ffmpeg -i 5.avi -sameq intermediate5.mpg
ffmpeg -i 6.avi -sameq intermediate6.mpg
ffmpeg -i 7.avi -sameq intermediate7.mpg
ffmpeg -i 8.avi -sameq intermediate8.mpg
ffmpeg -i 9.avi -sameq intermediate9.mpg
cat intermediate1.mpg intermediate2.mpg intermediate3.mpg intermediate4.mpg intermediate5.mpg intermediate6.mpg
intermediate7.mpg intermediate8.mpg intermediate9.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -sameq FINALOUTPUT.avi
And Here is the final outcome:
Monday, May 10, 2010
Thursday, April 22, 2010
Proof of Concept: Snowcrash Effect
Here we go.
Using FFMPEG and Netpbm in Cygwin I created an effect that turned out very close to what I had in mind. With more time I can clean the images up, and I probably need different film footage with more consistent lighting. Anyway I'm very proud of what I produced, which is an original effect that has probably been done before but while I searched, it was to be ungooglable.
I started with two versions of my video footage, one with the green masked out and the other with red masked out. To create the mask I converted the selected brightness of red and green to blue and red respectively. This was done to avoid too much of the image to be masked and gave me more control in this aspect.
With the red masked out, I placed the subject in video footage into the first background which was the garage. I then created a mask from the green and applied it to the second background which was the dojo and ninja suit. I merged the two and created an animated video which shows the figure in the garage, then the original background is pulled off of everything around him to leave him standing as a ninja training in a dojo.
#!/bin/bash
# create folders for images
mkdir blueconvert
mkdir bluemasked
mkdir RedImages
mkdir maskinvert
mkdir merged
mkdir Snowcrashed
mkdir GreenImages
mkdir FinalMerge
mkdir GreenMask
mkdir greenconvert
# extract images from Original video file
echo "Extracting Images"
ffmpeg -i RedFootage.avi -f image2 RedImages/%d.ppm
ffmpeg -i GreenFootage.avi -f image2 GreenImages/%d.ppm
# Take wanted red from all images Blue for mask
echo "Turn Red To Blue"
FILES=RedImages/*.ppm
b=1
for i in $FILES
do
ppmchange -closeness=29 red blue RedImages/$b.ppm >blueconvert/$b-blue.ppm
let b=$b+1
done
# Take all the blue and mask it out
echo "Make mask out of blue"
FILES2=blueconvert/*-blue.ppm
c=1
for i in {1..76}
do
ppmcolormask -color blue blueconvert/$c-blue.ppm >bluemasked/$c-masked.pbm
let c=$c+1
done
# Invert the color mask
echo "Inverting Mask"
FILES3=bluemasked/*-masked.pbm
d=1
for i in {1..76}
do
pnminvert bluemasked/$d-masked.pbm >maskinvert/$d-maskinvert.pbm
let d=$d+1
done
# Merge the background with the foreground
echo "Merging Images"
FILES4=maskinvert/*-maskinvert.pbm
e=1
for i in {1..76}
do
pamcomp background/FirstBackground.ppm RedImages/$e.ppm -alpha=maskinvert/$e-maskinvert.pbm >merged/$e.ppm
pamcomp background/FirstBackground.ppm RedImages/$e.ppm -alpha=maskinvert/$e-maskinvert.pbm >FinalMerge/$e.ppm
let e=$e+1
done
# Take wanted green from all images Red for mask
echo "Turn Green To Red"
FILES=GreenImages/*.ppm
z=1
for i in {1..76}
do
ppmchange -closeness=40 green red GreenImages/$z.ppm >greenconvert/$z-green.ppm
let z=$z+1
done
# Create Mask for Green Image
echo "Creating Mask for Green Image"
FILES5=greenconvert/*-green.ppm
f=1
for i in {1..76}
do
ppmcolormask -color red greenconvert/$f-green.ppm >GreenMask/$f-masked.pbm
let f=$f+1
done
# Apply Green Masked to the merged images
echo "Applying Green Mask to Images"
FILES6=GreenMask/*-masked.pbm
g=1
h=26
for i in {1..76}
do
pamcomp background/FinalBackground.ppm merged/$g.ppm -alpha=GreenMask/$g-masked.pbm >FinalMerge/$h.ppm
let g=$g+1
let h=$h+1
done
#convert manipulated images into a video
echo "Creating Video"
ffmpeg -f image2 -i FinalMerge/%d.ppm Snowcrashed/SnowcrashedOutput.avi
Using FFMPEG and Netpbm in Cygwin I created an effect that turned out very close to what I had in mind. With more time I can clean the images up, and I probably need different film footage with more consistent lighting. Anyway I'm very proud of what I produced, which is an original effect that has probably been done before but while I searched, it was to be ungooglable.
I started with two versions of my video footage, one with the green masked out and the other with red masked out. To create the mask I converted the selected brightness of red and green to blue and red respectively. This was done to avoid too much of the image to be masked and gave me more control in this aspect.
With the red masked out, I placed the subject in video footage into the first background which was the garage. I then created a mask from the green and applied it to the second background which was the dojo and ninja suit. I merged the two and created an animated video which shows the figure in the garage, then the original background is pulled off of everything around him to leave him standing as a ninja training in a dojo.
#!/bin/bash
# create folders for images
mkdir blueconvert
mkdir bluemasked
mkdir RedImages
mkdir maskinvert
mkdir merged
mkdir Snowcrashed
mkdir GreenImages
mkdir FinalMerge
mkdir GreenMask
mkdir greenconvert
# extract images from Original video file
echo "Extracting Images"
ffmpeg -i RedFootage.avi -f image2 RedImages/%d.ppm
ffmpeg -i GreenFootage.avi -f image2 GreenImages/%d.ppm
# Take wanted red from all images Blue for mask
echo "Turn Red To Blue"
FILES=RedImages/*.ppm
b=1
for i in $FILES
do
ppmchange -closeness=29 red blue RedImages/$b.ppm >blueconvert/$b-blue.ppm
let b=$b+1
done
# Take all the blue and mask it out
echo "Make mask out of blue"
FILES2=blueconvert/*-blue.ppm
c=1
for i in {1..76}
do
ppmcolormask -color blue blueconvert/$c-blue.ppm >bluemasked/$c-masked.pbm
let c=$c+1
done
# Invert the color mask
echo "Inverting Mask"
FILES3=bluemasked/*-masked.pbm
d=1
for i in {1..76}
do
pnminvert bluemasked/$d-masked.pbm >maskinvert/$d-maskinvert.pbm
let d=$d+1
done
# Merge the background with the foreground
echo "Merging Images"
FILES4=maskinvert/*-maskinvert.pbm
e=1
for i in {1..76}
do
pamcomp background/FirstBackground.ppm RedImages/$e.ppm -alpha=maskinvert/$e-maskinvert.pbm >merged/$e.ppm
pamcomp background/FirstBackground.ppm RedImages/$e.ppm -alpha=maskinvert/$e-maskinvert.pbm >FinalMerge/$e.ppm
let e=$e+1
done
# Take wanted green from all images Red for mask
echo "Turn Green To Red"
FILES=GreenImages/*.ppm
z=1
for i in {1..76}
do
ppmchange -closeness=40 green red GreenImages/$z.ppm >greenconvert/$z-green.ppm
let z=$z+1
done
# Create Mask for Green Image
echo "Creating Mask for Green Image"
FILES5=greenconvert/*-green.ppm
f=1
for i in {1..76}
do
ppmcolormask -color red greenconvert/$f-green.ppm >GreenMask/$f-masked.pbm
let f=$f+1
done
# Apply Green Masked to the merged images
echo "Applying Green Mask to Images"
FILES6=GreenMask/*-masked.pbm
g=1
h=26
for i in {1..76}
do
pamcomp background/FinalBackground.ppm merged/$g.ppm -alpha=GreenMask/$g-masked.pbm >FinalMerge/$h.ppm
let g=$g+1
let h=$h+1
done
#convert manipulated images into a video
echo "Creating Video"
ffmpeg -f image2 -i FinalMerge/%d.ppm Snowcrashed/SnowcrashedOutput.avi
Friday, April 16, 2010
Film Footage: Snow Crash Effect
Looks rough right now but maybe you can start to get an idea for what my effect is going to look like with this footage I have filmed.
The lighting inconsistency with the green sheet is intentional for the effect.
The lighting inconsistency with the green sheet is intentional for the effect.
Sunday, April 11, 2010
Rio Grande Valley SIGGRAPH Meeting: The Making of Tim Burton's Alice in Wonderland
An interesting presentation and Q&A session by Bob Winter, CG Supervisor of Sony Imageworks Albuquerque branch, and Jeff Schu, Lead Animator, for the latest film incarnation of "Alice In Wonderland" was held this past Saturday.
Bob Winter explained how the movies effects were created and how every frame of this film was manipulated in some way, either digitally or physically. What I found surprising about his explanation is that when applying the effects, most of the characters were not computer generated, but distorted afterward. For example, in the scenes with the Queen of Hearts, Helena Bonam Carter's scene is shot multiple times from multiple angles, with and without every single character in the scene, then the distortion to make her head gigantic and her body tiny is applied; without turning her into a computer generated character (the technique I wrongfully believed was being used at first). The scene is then pieced back together and she seamlessly interacts with the other characters in that scene.
Jeff Schu broke down one shot of the movie, illustrating the steps that an animator must go through to get to the final polished product. They start with a very rough animatic given to them by the director, and work up a rough CG animation based on this animatic which goes back to the director. There is a back and forth with the animators and director over the course of two and a half months, an animation is worked up and sent to the director and he sends his review of the latest one explaining what he likes, dislikes, what should be added, removed or any new ideas he came up with. After the two months of discourse, the final polished 10 seconds of animation is ready to be put into place with the rest of the movie. It wasn't a surprise to me how much work goes into movies like "Tim Burton's Alice In Wonderland" but it was surprising to see how the animators work with a director they never even meet.
And just for the hell of it, VIA College Humor, this is how I imagine it really is to work with Tim Burton.
Bob Winter explained how the movies effects were created and how every frame of this film was manipulated in some way, either digitally or physically. What I found surprising about his explanation is that when applying the effects, most of the characters were not computer generated, but distorted afterward. For example, in the scenes with the Queen of Hearts, Helena Bonam Carter's scene is shot multiple times from multiple angles, with and without every single character in the scene, then the distortion to make her head gigantic and her body tiny is applied; without turning her into a computer generated character (the technique I wrongfully believed was being used at first). The scene is then pieced back together and she seamlessly interacts with the other characters in that scene.
Jeff Schu broke down one shot of the movie, illustrating the steps that an animator must go through to get to the final polished product. They start with a very rough animatic given to them by the director, and work up a rough CG animation based on this animatic which goes back to the director. There is a back and forth with the animators and director over the course of two and a half months, an animation is worked up and sent to the director and he sends his review of the latest one explaining what he likes, dislikes, what should be added, removed or any new ideas he came up with. After the two months of discourse, the final polished 10 seconds of animation is ready to be put into place with the rest of the movie. It wasn't a surprise to me how much work goes into movies like "Tim Burton's Alice In Wonderland" but it was surprising to see how the animators work with a director they never even meet.
And just for the hell of it, VIA College Humor, this is how I imagine it really is to work with Tim Burton.
Friday, April 9, 2010
Script Clip Storyboard: Snowcrash Effect

In my storyboard I depict a scene where Hiro puts the sunglasses on and the room around him becomes the digital realm. I plan to have the real room "un-peel" itself off of him and his surroundings.
For my concept in separating background from foreground objects, using green screen techniques or others, I am creating an effect inspired by the book Snow Crash. In the book the protagonist, Hiro Protagonist; who is also the hero, dons a set of goggles that place him virtually into an internal digital network where he has access to a wealth of information and also a dojo where he can practice with his samurai sword, which is in reality a piece of rebar.
Tuesday, March 30, 2010
This Is Tron
What's the big deal? The year was 1982, you simply didn't see anything like these effects in movies at that time. Tron was the first theatrically released film to incorporate fully rendered computer generated images as backdrops, vehicles and characters. The biggest special effects anyone had seen by that point were in the Star Wars movies, so when Tron was released people had a hard time wrapping their brains around the concept of the film.
Today the general audience will look at these outdated special effects and scoff, citing "AVATAR" as having such amazing computer generated imagery that it is difficult to tell the difference between what is real and what is an effect. But when I look back at the effects in Tron I see something with more character and meaning, something that was hand-crafted and the work put into the film meant more than just the click of a mouse button on an editing program.
Wednesday, March 24, 2010
Animated Sequence Using A Script
I wrote the following bash script that will take the video provided and change all the green in the video and make it red.
so this:
becomes this:
#!/bin/bash
# extract images from 00006.mts file
echo "Extracting Images"
ffmpeg -i 00006.mts -f image2 %d.ppm
# replace green from all images to red
echo "Replacing Green"
FILES=*.ppm
b=1
for a in $FILES
do
ppmchange -closeness=42 green red $b.ppm >$b-red.ppm
let b=$b+1
done
#convert manipulated images into a video
echo "Creating Video"
ffmpeg -f image2 -i %d-red.ppm GreenNowRed.avi
so this:
becomes this:
Subscribe to:
Posts (Atom)