Home » Featured, Headline, html5

Mycellium Source Code Available

6 July 2011 2 Comments
Mycellium Source Code Available

Last time [LINK] I discussed how virtual Worms could “eat” a picture, seeking out the lighter or darker areas as food and leaving a trail in their wake. I’ve dumped the source here: http://francisshanahan.com/demos/worms/test.html so you can interact, create your own images and figure out how it’s done. To be honest I haven’t had much time to clean this up as I’ve been focusing on other things and doing a bit of travel for work so be gentle.

Just enter a URL of an image and click “create drawing” to being. The page will load that image into a hidden canvas and use it as reference to draw the picture. You should use Chrome of course but this should work in all HTML5 compatible browsers.

Room for improvement might be to place the code in an enclosure, cleaning up the global DOM namespace or multi-thread it this using Web Workers although the current speed is acceptable. Web Workers in this instance might be overkill.

Enjoy.

2 Comments »

  • Joseph said:

    Do you think it would be possible to create a live interactive version of this? I’m thinking along the lines of: Someone visits a page, and starts the program, their webcam activates and a live video portrait of them is displayed in this style, perhaps actively being created in this style.

  • Francis (author) said:

    @Joseph, it might be tough to do that, especially since most browsers don’t support accessing the webcam (yet). I have managed to do video capture through javascript and there is already a post on this site about that but only with an experimental build of Opera. Maybe in the future…

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.