Scientific American

May 28 2010 Published by under ActionScript, Flash


In the June 2010 issue of Scientific American, on page 58, there is an article entitled, “Is Time an Illusion?” by Craig Callender. You can see it here:


The large artwork on the first and last pages of the story, and a bit more subtly in some of the in between pages, is by yours truly.


This began about two months ago when I was contacted by Scientific American, asking if I would be interested in contributing some art work for an article. They were interested in some of the pieces on my other site, Art From Code, in particular a few pieces I had entitled Space Time Color. Of course, I said I would be interested and they sent over the article and asked me to come up with some rough ideas within a couple of weeks, and shortly after that some high res images for print.

Amazingly, I was able to dig up the source code that had created the Space Time Color images. The thing was, I now needed to create four separate pieces in both low res and later high res, save them out, and have the ability to reproduce and tweak each piece. Random code on the timeline of an FLA would just not do in this case. So I extracted the code out into classes and created an AIR application in Flash Builder 4.

The app is essentially a particle generator with a number of invisible attractors that affect the particles’ paths. A number of particles appear at the bottom of the screen and have an initial upward velocity. Here’s what it looks like:

Each circle is an attractor and can be dragged anywhere on the canvas. Each has a numeric stepper attached to it to adjust its strength. Of course, this number can be negative, which makes it repel particles. As each particle moves, it draws a line onto a bitmap.

Although the bitmap is scaled on the stage to 600×600, internally it is 4000×4000 pixels, and you can zoom into the image full size, at which point you can drag it around within its window.

Other things you can see in the UI there are options to change the background color, change the number of particles and number of attractors, show or hide the attractors, and draw in a lower resolution preview mode. When I got a picture that looked good, I could hit save. I modified the default PNGEncoder class to be asynchronous (I think I posted about that at the time), which allowed me to throw in a saving progress bar.

The cool thing is that when an image is saved, a configuration file with all the important properties are also saved with the same name. The file names for both are based on the time stamp of the point they were saved. So in addition to the image file, “space_time_2010-5-28_22.16.34.png”, it saves a file called “space_time_2010-5-28_22.16.34.txt” that looks like this:


This allowed me to load back in the exact configuration for any specific image that had been saved at any time. Although the app itself took a few days to get done, it then allowed me to quickly generate dozens of different images, then go back through them, choose the ones I liked, reload them, and tweak them a bit more before saving them out again.

Again, the images were exported as 32-bit PNGs at 4000×4000. Only the trails themselves were represented; I left the background color transparent, and then opened up each final image in PhotoShop, adding a white background later there. I thought they might want to experiment with different background colors, but as it is, they liked the white anyway. While I was in PhotoShop, I played with some different filters and effects and got some other cool results, but what wound up in the magazine was pretty much straight out of Flash.

Anyway, I’m pretty excited to have some of my work in such a prestigious magazine as Scientific American. Another notch in the keyboard. What’s next?

21 responses so far. Comments will be closed after post is one year old.

  • polyGeek says:

    Way to go. You’re my hero.

  • KP says:

    Pretty interesting. Congrats!

  • sakri says:

    Getting an FWA is for sissies, the cool kids get Scientific American 😉

    Very cool! Congrats!

  • saumya says:

    Awesome work and inspiring the work process too.

  • Fabianv says:

    Well done man, thats great news 🙂

  • dVyper says:

    Quite excellent. Well done 🙂

  • Lawrie says:

    Amazing! Very cool end results, and it’s really interesting to see your process. Any plans to release the tool?

    I guess the max size for this would be 4000 pixels / 320 dpi = 12.5 inches squared?

    • kp says:

      Thanks everyone.

      Lawrie, yeah, the largest square bitmap you can create is I think 4095×4095 so I rounded it down to 4000. As you mentioned, magazines go with around 300 dpi, so that was fine. Didn’t need to do any bitmap tiling. I might release the tool someday, but I’ll give it some time. I think it would be rude to create some art for pay, and then release the tool free so anyone recreate the same thing the next day. 🙂

  • Steve says:

    Keith, I am very inspired by this and the Art from Code site. I’d love to build a similar sort of application. I know Flex/AS3 quite well, but I could use some suggestions to get started with generating art.

  • Too cool man! You rock \m/

  • wanluqman says:

    Does time really exist, a mind boggling quest and really nice scientific art works. Congrats

  • Congratulations! you deserve it. and thank you for all the help.

  • Ted says:

    OT sorry but really looking for a link you posted ages ago to a great talk by a guy saying how people have time to do stuff if they stop watching TV. Like all Wikipedia represents x hours work which is the same number of hours people watch TV adverts in the US on one saturday night. You rated it highly as I recall for time management but I cannot seem to find it again – want to pass it on to someone who says they don’t have time to read and stuff. Could you post the link if you find it. Thanks.

  • Steve Nelson says:

    Cool Keith! I noticed the images in Flickr. Nice to get some details and a little of the back story here. Glad your artwork is a reality even if maybe time isn’t.

  • Ted says:

    Thanks Keith that was exactly what I meant and just as good as I remember too.

  • jadd says:

    hi Keith,
    it’s always nice to see your work in ArtFromCode, but the question is: what kind of tools do you use. I remember an old your library: Brevity! Or do you use processing or whatelse?
    Cheers from Italy, Roberto.

  • TheDarkIn1978 says:

    compelling work. congratulations.

  • Kindermode says:

    Very interesting – could win an award

  • […] of code here and there and realized I was making a particle system with attractors, basically like what I did for Scientific American a while back. So I followed that path and came up with something quite similar. Basically, a number of particles […]