video & canvas: special effects
By Paul Rouget on Wednesday 25 February 2009, 14:35 - shared - Permalink
From a <video/> element, you can play with the pixels of each frame. For example, you can replace each green pixels by a transparent one.
Here is little demo (Firefox 3.1 needed): http://www.mozbox.org/pub/green/.
42 lines of Javascript, powerful :)
If you don't have Firefox 3.1, see the Chris' screencast: http://www.0xdeadbeef.com/weblog/?p....
Comments
Über great. I've found a small bug though, I think it comes from the video implementation, not from your code.
If you use the control to move the position in the video *without* first pausing it, your copying of the data won't work anymore, and the two screen on the right will be frozen. Maybe the events are no more fired. If you pause and then restart it, it works again.
I've adapted this post into an article on MDC with an explanation of how it works:
https://developer.mozilla.org/En/Ma...
Very cool demo!
I added a few filters to it last night.
I still need some work to succeed in adding a moustache to Tristan though:-)
http://wordpress.chanezon.com/?p=16...
P@
I've adapted this post into an article on MDC with an explanation of how it works
http://yarismak.com