Check out my
new book!
HTML5 Games book
Pocket Full of Canvas One thing I found interesting when I did the JuicyDrop music visualization was MilkDrop's deformation effects. Rather than processing deformations for each and every pixel it works on a grid of points and then just interpolates the results for the actual pixels. I sort of mimicked that in JuicyDrop but in a simpler way. The grids used in JuicyDrop are something like 5x5 to 9x9 where MilkDrop uses much higher resolution grids and instead of doing per-pixel interpolation, the grid points are used to cut out triangles from the previous frame and paint them on the new frame, slightly transformed.


Since the deformations are usually very small when seen on a frame-by-frame basis, you can get some pretty good results even with fairly low resolution grids, and most recent browsers are more than capable of rendering 100 or even more triangles on a canvas. In the end, I was pleasantly surprised at how well everything turned out since I wasn't even sure I was going to get anything remotely close to what the original MilkDrop plugin produced.

While I still plan on doing some more work on JuicydDrop eventually, I decided to rip out just the grid deformation part and built something new around it. You see, every now and then I get the urge to just throw something quick together and make some flashing light or dancing balls or whatever but usually that urge comes when I only have 30 minutes to spare. So I figured I'd try to build a mini framework for making stupid demo effects and stuff like that.

I've ended up with a small application that loads simple scripts, exposes a bunch of functions to these scripts and then takes care of rendering and processing whatever the script tells it to. It's probably best explained by just taking a look at it. The whole idea was to make it as easy as possible for me to just throw some silly effect together real quick and hopefully not write too much code in the process, so it might not be the most thought through design but it gets the job done. The functions available range from basic drawing and image processing (via Pixastic) to audio data and 3D (via Pre3D).

There's no larger goal with this and there are already more robust and more elaborate frameworks out there for programming and animating graphics with JavaScript/Canvas(Processing.js for instance) so this is just my own little time-sink. You're of course welcome to play around with it, modify the existing scripts or even make your own.

To wrap things up, I made a little a demo comprised of scripts I cooked up while testing and developing this thing (as well as a few adaptations of other people's work). I totally recommend using Chrome and if possible, the dev channel as it's given me by far the best performance and visual appearance.

Watch the demo here

Play around with the application here
⇓ 8 comments Amad

This is so cool! I've always wanted an editor like this. Processing.js isn't that, its not fast when it comes to effects and you have to do quirky and inefficient things (especially in pixel manipulation) if u want to get more advanced, not very canvas like. This is in javascript, really fast (in chrome at least) and as a bonus has pre3d and pixastic integrated.. so does this have a license? :D

September 3, 2009 at 6:07 AM
Jacob Seidelin

Thanks :-) No license yet. I'm still contemplating what it's going to become or if this is it. I'll probably end up MPL licensing it.

September 3, 2009 at 6:19 AM
Jemma

Great cool. It is very interesting information. We appreciate the time you must have taken to present this information so clearly. Thanks so much for posting this information!
games

October 22, 2009 at 3:44 AM
Francesco

RAH
I've spent hours trying to figure out how the blob one works because I've been wanting to make something similar in flash. Is there any way someone could explain how it works?

btw awesome work! :D

December 2, 2009 at 5:30 PM
Anonymous

@Francesco:

Use the source, Luke.

December 26, 2009 at 9:18 PM
createwall

Upload your photo or browse our image gallery to print photos on canvas, photo prints or fine art prints. We have exclusivity on many of the images displayed in our gallery and these cannot be purchased anywhere else. Our payment process is quick and easy to use and most importantly secure.
thanks
print photos onto canvas

June 15, 2010 at 2:14 AM
Anonymous

It's very interesting!!!
Thank you!

August 13, 2010 at 10:19 PM
Canvas Art

Very useful and interesting post.

December 29, 2010 at 12:19 PM
Post a Comment