I've been playing a lot with Flash 8's bitmap features in conjunction with webcams, and will be releasing a few of the resultant experiments over the next week or so. The first of them is pretty simple, though it took some tweaking to get right.
This experiment simulates a snowfall with 400 snowflakes on screen, each with random size, rotation, speed and blur (using BlurFilter). Each of them is independently affected by wind (as partially controlled by your cursor's x position). That Flash can run it all fluidly is impressive in itself, but of course there's more. It's also monitoring the webcam input, detecting edges, and making the snowflakes settle gently on any horizontal surface they encounter - pretty cool.
I'm achieving this with a combination of convolution, horizontal blurring, color adjustments, thresholding and pixel sampling. It's relatively processor intensive with 400 flakes, but it runs at the full 30 fps on my G5.
You can see the experiment below. If you don't have a webcam, you can still see the snowfall, and I've appended a picture of it in action below. If you do, try playing around with it - one of the neatest things I think is to let some snow pile up on your head or shoulders and then brush it off with your hand... virtual dandruff! Note that it obviously works best with adequate lighting, and good contrast (ie. your white shirt against a white wall won't gather any snow).
Requires Flash Player 8. If the snow isn't sticking to edges, you probably have an older player.
Also check out Gallery Incomplet (incomplet.org) for other Flash experiments.
Here's a sample image for those of you without webcams:

Another image, I just liked the way the snow piled up on the graphics on this shirt:

Comments (68)
Wow, that is very, very cool. I've just had a load of people grow snow eyebrows and 'taches!
Posted by: Paul Neave at August 15, 2005 11:29 AMURL: http://www.neave.com/
amazing!
Posted by: Valters Boze at August 15, 2005 11:37 AMURL: http://www.djnet.lv
Cool stuff, reminds me of this:
http://www.setpixel.com/content/?ID=snow
Posted by: ghopper at August 15, 2005 12:14 PMURL: http://none
It's not fair - I want to play with the new flash too :(
I wnow I probably could with mtasc and stuff but it's not the same.
Anyway, some really good work here, just the sort of stuff I was planning to do with processing but I might hold on now.
Posted by: Jon B at August 15, 2005 01:31 PMURL: http://www.scrwd.com
HI. are you using using cache bitmap to achieve the speed with bitmaps? Most of the docs talk about vector and cache bitmap but the speed increase also works with png's..etc is that true?
Posted by: ian at August 15, 2005 01:39 PMURL: http://www.mrgamechef.com
ghopper - while it's visually similar, it's totally different functionally, though I've been working on some similar concepts... I'll have to take a closer look at what he's been doing to see if it gives me any inspiration.
ian - the snowflakes are radial gradients, which are cached as bitmaps because of the blur filter that is applied to them. I'm not sure if caching a PNG in an MC would increase performance, I would guess not, but it's possible that it would increase it very slightly due more to scoping than anything else.
Posted by: Grant Skinner at August 15, 2005 01:53 PMURL: http://gskinner.com/
That's awesome grant. I like how when I move the CAM the snow flakes "fall off". I got snowed on finally, too bad it doesn't snow in LA... :)
Posted by: Ivan at August 15, 2005 08:05 PMURL: http://www.blitzagency.com
That rocks! Nice work!
Posted by: Zok at August 25, 2005 03:55 AMURL:
It's Great!!!
Posted by: Japerman at August 25, 2005 06:17 AMAwesome!
URL: http://www.slaveofthemind.com
man that's really cool
Posted by: Igor at August 29, 2005 07:29 AMCheers
URL:
wonderful...
Posted by: dudu at September 15, 2005 04:31 PMURL: http://www.academia.nu
Hi
Yeaaah that is really innovative... Is the source public available ?
Best
Posted by: Igor at September 24, 2005 06:02 AMURL:
its amzing+irrestible.its an unimaginable stuff by sumone who is really vry vry gr88888888888888888 CREATOR in my eyes!
Posted by: RaajiKhanna at September 29, 2005 03:41 PMhope i get to sit besides one of thm-ONE DAY!!!
URL:
Looks great! I had to put on an extra sweater to stand the imaginary cold!
Posted by: RedDragon at October 13, 2005 01:59 AMURL: http://www.spiritz.nl
this is totally cool, is the source available somewhere??
Posted by: Robert at October 20, 2005 04:09 AMURL:
in one word: Wow!
Very inspiring. Seems you have already a lot of experience with all those new flash features.
Do you think it's posible to create Eye-Toy games? in other words, do you think the flash actionscript interpreter is quick enough for more complex eye-toy pixel calculation?
Keep up the good work - Marco
Posted by: Marco at November 7, 2005 01:23 AMURL:
Grant, very good work man.
Posted by: Eric at November 7, 2005 11:40 AMAlways impressed with the type of stuff you come up with keep it up!
URL: http://www.ericchan.ca
That looks great, cant wait til next week for Spark, the ideas will be flying around my head (just have to find the ways of getting them on screen then!)
Posted by: Craig Goodwin at November 8, 2005 05:10 AMURL:
hmm i have an isight/mac but can't get my camera to work in the browser - what's the trick?
Looks awesome!
MacBoy
Posted by: mac boy at November 15, 2005 03:18 PMURL:
yep, I also have a mac and have been trying to find out how to make my EyeToy work as a webcam, but I can't find anything! Can you help me?
Posted by: Rebecca at November 19, 2005 10:47 PMThanks!
Bekky
URL:
just right-click on the flash, choose settings, then go to the camera tab (bottom) and choose the correct cam.. hope it helps..
xa4
Posted by: Xavier Righetti at November 24, 2005 11:18 PMURL: http://xa4.ch
would this work with any instant messengers ?
Posted by: john cranford at December 7, 2005 02:32 PMURL: http://www.sawifi.tk
This looks awesome, you are realy good! Would love to have that on my site... http://www.onmywebcam.com wow what i nice thing... Love it!!!
Posted by: Aesome at December 10, 2005 02:07 PMURL: http://www.onmywebcam.com
I'm a bit confused. I get the concept and I do think it's great, but all I see is the snow itself and no webcam picture (Yes, I have a webcam!). I have Flash 8 installed and I've tried in both Firefox and Internet Explorer (On a sidenote, the snow looks sharper in IE than FF)and my webcam isn't displaying. I've also tried reselecting my webcam from the settings options.
Any thoughts?
Posted by: Neil at December 13, 2005 07:47 AMURL: http://www.theworkof.co.uk
Very nice effect...
Posted by: Chris at December 19, 2005 06:55 PMURL: http://www.csimagedesign.com
doesn't work with video feed from within max os/x, safari.... seems to work fine on other browsers though.
Posted by: onebitpixel at December 20, 2005 10:30 AMURL:
It was tested fully in Safari. Be sure you have the right video source selected:
Posted by: Grant Skinner at December 20, 2005 10:53 AM- right click on the Flash movie
- choose Settings...
- click the webcam icon
- choose the appropriate video source (ex. an iSight is IIDC Firewire Video)
URL: http://gskinner.com/
Is there any way to blend this with a current flash animation, i would love this to work with my site??
Like to have the snowflakes fall on the letters in the animation? Has anyone tried it?
Posted by: Jacob at December 20, 2005 06:11 PMURL:
oh!!! it's a REAL FUN :)
Posted by: Nek at December 27, 2005 08:11 AMURL:
Looks awesome!
Posted by: fermuar at January 18, 2006 12:49 PMURL: http://www.zile.gen.tr
ike to have the snowflakes fall on the letters in the animation? Has anyone tried it?
Posted by: http://trlist.gen.tr at January 20, 2006 04:50 PMURL: http://trlist.gen.tr
is there anyway for interactions with webcam and buttons in flash?
Posted by: eski at March 8, 2006 11:56 PMURL:
This is just GREAT !
Posted by: phrEEk at March 13, 2006 01:02 PMURL: http://www.hecatonta.com
man, just a few months ago i tried flash and my webcam and everything worked fine. then i plugged my webcam in recently and tried to use it with flash but it's no longer displaying video and the currentFPS reported is 0.
my webcam works on msn and with a little video capture program i wrote in python, so i don't understand why flash is not working. anyone have any ideas?
Posted by: robert at April 18, 2006 02:39 PMURL:
Wow, that is awesome. I am working on a experimental Flash 8+webcam project and was wondering if you have time to check it out (www.alivebroadcast.com). Alive Broadcast is a web based service that allows you to save webcam images directly to the server, and then share them anywhere on the web. Thanks
Posted by: andreit at May 16, 2006 09:07 AMURL: http://www.alivebroadcast.com
Hi
thank you its very useful for me :)
Posted by: Diviner at June 18, 2006 04:20 AMURL: http://diviner.blogspot.com/
Nice... Very nice effect...
Posted by: Con-Verse at July 18, 2006 03:49 PMURL: http://www.con-verse.fw.hu
Saw the fire one, and I think the fire one look better! The snow effect is cool too but personal preferences!
Posted by: FGS at July 27, 2006 09:25 AMURL: http://www.flashgamecript.com
There goes my productivity for the next hour... this is just too fun :)
(worked flawlessly with my Macbook pro)
Posted by: Pedro Melo at August 24, 2006 04:12 AMURL: http://www.simplicidade.org/notes
can this be used on msn when my grad kids are looking at me would be cool they will think its snowing here on me
Posted by: rick at December 3, 2006 04:20 PMURL:
my like
Posted by: amanda at December 16, 2006 11:54 AMURL:
It's realy COOL!!!!!
Posted by: Alex at December 23, 2006 08:46 AMURL: http://www.construction-tools.info/
djdjjjdpdsd comme sa
Posted by: merde at January 10, 2007 12:21 PMURL: http://azerert
I am working on a project that will be going over to prague this summer (http://www.pq.cz/07/stred_basicinfo2.html) and your winter snow example is exactly the type of effect that we would like to create. Currently we are using Flash 8 along with a maxMSP/jitter to produce this real-time performace...would you be able to provide the source code, or file itself?
Thanks
Posted by: matt at January 24, 2007 07:22 PMURL: http://na
Awesome !
Posted by: car0line at February 9, 2007 02:20 PMURL:
....
Posted by: g at April 10, 2007 04:13 AMURL:
Hi there I am looking for the actionscript for ghostly mirror see http://www.setpixel.com/content/?ID=ghostlymirror. Can anyone help??
Thanks
Posted by: Emma Chapman at April 12, 2007 07:18 AMURL:
Hi there, working on a final year uni project - wonder if you could help us with accessing the code for this type of project/motion tracking?
Nice work, thanks.
Posted by: Jenni at April 12, 2007 09:42 AMURL:
hey i love this its so cool would you be able to email me the scorce code for this it would be much appreceated thx
sry for my spelling
Posted by: David at May 5, 2007 10:17 PMURL:
Cool!!! Ilike FLA file
Posted by: Jack Sparrow at May 30, 2007 10:38 AMURL:
Great stuff!
Posted by: John at June 7, 2007 06:32 PMURL: http://www.iwantto.us
Amazing!
Posted by: fosk at June 22, 2007 12:07 PMURL: http://www.fosk.it
hey, that is cool.
Posted by: Marcus Wan at July 3, 2007 07:48 PMcheck out some of mine:
http://members.westnet.com.au/lmwan/projects.html
URL: http://members.westnet.com.au/lmwan
Just amazing
Posted by: Platfuse at July 13, 2007 09:04 AMURL: http://www.platfuse.com
Hi it's really cool! Damn good try!
Posted by: Kathir at July 17, 2007 10:24 PMURL:
Hi... i need help.. how can i do a flash project that take streaming from mine cam and shows it for others?
comtakt me by my mail if you know any answer or have links who can help......
Posted by: Micael Svensson at September 3, 2007 04:12 PMmy email:
Apolio_Diablo@hotmail.com
URL:
was wondering if you are able to provide the source code? =) well, is amazing. =)
Posted by: yan at September 17, 2007 10:59 PMURL:
c'est de top se jeux
Posted by: levent at September 22, 2007 05:50 AMURL:
ya pas mieus lui qui di que sait nule il se tronpe
Posted by: levent at September 22, 2007 05:52 AMURL:
I am gobsmacked! THIS is really impressive. Snow all over me, and I'm in front of a blazing fire!
Posted by: Don Slaven at October 8, 2007 11:44 AMURL:
Great work, very nice effect.
Very impressive.
- Cheers for sharing it with us.
Posted by: Alin at October 19, 2007 01:35 AMURL:
Salut
Posted by: Dupont at October 24, 2007 05:06 AMURL:
GREAT !!!!!!! I felt from my chiar !!! ;) VERY VERY Impressive !!!!!!!!!!!!!
Posted by: Demian at November 1, 2007 09:40 AMURL: http://beed.co.il
is the source or the fla available??
Posted by: roadking5 at November 12, 2007 02:14 PMURL:
I WOULD LIKE A COPY OF THIS FOR A BACK DROP IN A WEDDING?? ANYWAY I CAN GET OE IN DVD FORM?
Posted by: lisa garbiel at January 28, 2008 05:35 PMURL:
I WOULD LIKE A COPY OF THIS FOR A BACK DROP IN A WEDDING?? ANYWAY I CAN GET OE IN DVD FORM?
Posted by: lisa garbiel at January 28, 2008 05:36 PMURL:
c'est nul je prefair celui avec les flames
Posted by: mattéo at March 21, 2008 10:48 AMURL:
Is there a way of setting the camera quality, I've tried doing this and although my quickcam sphere/orbit will do a higher resolution, is it correct to say that you can't see the higher quality locally unless you're connecting to a bona-fide flash communication server?
Posted by: Derek Foley at June 26, 2008 08:37 AMURL: http://www.derekfoley.com