Hey there, it looks like this is your first time here. May I suggest subscribing to this blog and checking out these articles.

SOME RANDOM DUDE

Actionscript 3 Video Color Sampler Experiment

12.06.07 @ 6:48 am

Actionscript 3 Video Sampler

A while back I published a small Actionscript experiment that sampled colors of video and displayed a matrix of the sampled colors it retrieved. I mentioned that I would be posting a follow-up once I ported all the code to Actionscript 3 and was able to do some interesting experiments with this technique. The current color sampler can give you the rgb code, red channel, green channel, blue channel, hue, saturation and brightness. It took a bit of time, but I have made five different motion treatments generated from my color sampling engine. The port of the color sampler class to Actionscript 3 made a significant difference in terms of performance and offered many more possibilities to what I could attempt. These five experiments are really just scratching the surface of what can be done with this technique - I have already thought of 3 or 4 different methods I would like to create.

Since I have been making a big deal about Nine Inch Nails on this site ever since the Year Zero hoopla, I thought I would use a few music videos from the aforementioned band. I found a few of these videos worked especially well due to their color composition.

I will be posting the full documented code with examples later this week. Until then, please feel free to download the color sampler class. Protected under the GNU Public License.

Select from the motion treatments below:

These videos are relatively large so I suggest clicking the ‘X’ button once you are done watching a video in order to move onto the next. If you keep the videos open, they will continue to progressively download and therefore can possibly slow down the next video you view.

Brightness Detection

This is the simplest treatment but no less interesting from my perspective. The scale of the crosses signifies the brightness in that particular region. This sampling technique is not too rough on the CPU either.

Only by Nine Inch Nails

You need to upgrade your Flash Player


Circular Hue Visualization

The hue value in HSV ranges from 0 to 360. I thought that worked perfectly with a axis-based visualization with the hue being the rotation. The brightness value signifies the scale.

The Becoming by Nine Inch Nails

You need to upgrade your Flash Player


Chain Visualization

This is another quite simple implementation with the X and Y coordinates of each anchor representing the brightness of the sampled area. This particular visualization works well with black and white samples with high contrast.

We’re In This Together by Nine Inch Nails

You need to upgrade your Flash Player


Diagonal Lines

This is easily the most challenging video to use due to its low tonal and brightness contrast. The lines are contrived from various computations of multiple sample values.

Survivalism by Nine Inch Nails

You need to upgrade your Flash Player


Vertical Casecade

The various shades of blue in this video made a sampling visualization extremely easy for this video. Opacity, height and color were influenced by color, brightness and saturation.

The Hand That Feeds by Nine Inch Nails

You need to upgrade your Flash Player


, , , , , , , , , , , , , , , , , , , , , , , ,

Liked This Post?

Well then, post the article to del.icio.us and subscribe to Some Random Dude's RSS Feed.

Show some comment love.

Total Donations for November:

$11.00

Want to help a good cause? Want to get this number higher? Learn how.

5 Responses to “Actionscript 3 Video Color Sampler Experiment”

  1. Gravatar
    $0.00 in Comment Love for November

    This is a cool idea. I wonder about sampling the HSV values and converting sending them to the background color of the web page, dynamically. It would also be cool to see the loudness values of your program tossed into the mix.


  2. Gravatar
    $0.00 in Comment Love for November

    Thats really cool… I’ve been experimenting with this myself. I will publish something shortly, the differance is that mine works with flickr instead of video. Excellent choice of videos by the way ;)


  3. Gravatar
    $0.00 in Comment Love for November

    I like your chain visualization the best. It is interesting to see how the peaks and valleys seem to exist in accordance to the positive and negative of the black and white film. Even when it gets an information overload the lines go all crazy. Very cool.


  4. […] video… Yes, I know, this is a good thing, but it broke my code for this, this, this and this. I have managed to partially fix a couple of them, but this is really my fault as well since the […]


  5. Gravatar
    $0.00 in Comment Love for November

    i have problems

    SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://www.somerandomdude.net/f/articles/sampler-as3/together.swf cannot access unknown URL. No policy files granted access.
    at flash.display::BitmapData/draw()
    at VideoColorSamplerFlash/sampleVideo()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at ()
    at SetIntervalTimer/onTimer()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()


Leave a Reply

Additional Doodads

Subscribe to Some Random Dude

Related Entries:

Most Commented Pages