I first discovered Processing in the summer of 2005. I downloaded the source code, had a play around with it and decided it wasn’t going to be worth me learning it. At the time I was very much design oriented in my endeavors and although I knew vaguely what the capabilities of Processing were, it’s lack of a substantial IDE or drawing tools made it no competitor to my main focus at the time: Flash.

Rediscovery & Inspiration

Fast forward 3 years and I’m now a developer, a code junkie, a command-line ninja. Although I sometimes miss the creativity that you get with design, I still love the art of writing code. I want the excitement of motion, interaction and form but also want the challenge of writing elegant software… I’d been thinking about re-visiting processing for a long time, hopefully it would satisfy these needs. I often kept an eye on the likes of Jonathan Harris & Flight 404 to see what they were up to, and was always inspired by the cool things these guys were doing with processing + generative art in general.

It was when a guy at work, David Standen started going on about processing, and his love for it that I thought “maybe i should look at this again”. I am after all now a programmer, and Processing is a DSL around Java, so why not learn it? I downloaded the latest version and started playing around…

Enter Pixel Path

I wanted something different, I ignored “good code” and went straight for the fun and creative, something non-interactive maybe. So what to do? I’ve always been really annoyed by the fact that I can’t really draw very well and I’ve never painted a picture in my life, so I decided to try and create some software that would create gorgeous looking “things”. Generative Art.

Inspired by this post I set about creating what would later become known as “Pixel Path”. The idea was simple, to analyze a given image, pixel by pixel and map every pixel to all other pixels of the same colour. Pixels would be identified by a dot and connected by lines, hopefully creating a sense of depth, texture and form.

Version 1 - Moss

The first version is based on a macro shot of a leaf, it maps every 100th pixel to up to another 100 pixels of identical colour. (Galleries each have 5 parts, use the thumbnails to scroll through them all.)

Total Pixels: 1,296,000 | Analyzed: 12,960 | Paths: 1,296,000

Version 2 - Skin

In the second version I tweaked the algorithms to introduce more depth, points are rendered at 80% opacity and paths at 20%. The amount of pixels to be analyzed was also reduced to every 3500th, but the mapping limit increased to 1000 paths. The reference image was a macro shot of a group of feathers.

Total Pixels: 1,296,000 | Analyzed: 370 | Paths: 370,000

Version 3 - Paprika

The third version used bezier curves to draw the paths with control points offset against the difference between the reference and target pixel. Every 850th pixel was analyzed up to 100 paths. The reference pixels in this version were distinguished with near 100% opacity. The image used was that of a red rose petal.

Total Pixels: 1,296,000 | Analyzed: 1,524 | Paths: 152,400

Version 4 - Rose

For version 4 I abandoned the dots for marking pixels, and instead relied on just the paths. The bezier curves were tweaked slightly to create smoother lines and only every 250th pixel was analyzed, up to 100 paths. The reference image was another rose petal, in pink.

Total Pixels: 1,296,000 | Analyzed: 5,184 | Paths: 518,400

Version 5 - White

Version 5 was a slight departure from the norm, I inverted the canvas colour and this time decided to map the reference pixel to it’s first match, then all other matches to the next match (creating a flowing path) This version also draws two sets of paths for every match, one straight and one curved. Opacities were also massively reduced to only 5% and analyzed pixels increased to every 900th for up to 1000 paths. The first reference image was a different set of feathers and the second a forest scene.

Total Pixels: 1,296,000 | Analyzed: 1,440 | Paths: 1,440,000

Version 5 - Forest

Next Steps

  • Introduce an element of randomness.
  • Experiment with noise.
  • Experiment with blending.
  • Introduce the z-axis.
  • Try using particles to generate “ink splats”.

6 comments

add your own

  1. # on 29 Feb 08 @ 10:38 Maya said this:

    Lovely new work! I too have just started with processing. The book turned up yesterday and I’m amazed at how easy it looks to get into straight away.

    I love the examples you created.

    Keep on keeping on!

    maya

  2. # on 29 Feb 08 @ 10:54 craig t mackenzie said this:

    Hi maya,

    thanks for the comment, i too got the book not so long ago, I’m addicted!

    I’m all ready thinking about implementing craig reynolds boid’s in a new sketch and i really want to try my hand at implementing some of the rules from the code on cellular automata.

    Processing is really great, it is very easy to get into, if you have previous coding skills you’ll find it easier, if not, the book is a great introduction to the basics also.

    Great blog by the way, I’m a big fan of white-out text.

    - craig

  3. # on 30 Mar 08 @ 4:27 mx said this:

    nice one, you’re getting some really beautiful results there.

  4. # on 30 Mar 08 @ 4:37 craig t mackenzie said this:

    thank you, i just had a look at you blog, some of your work is awesome!

  5. # on 21 Jun 08 @ 6:16 Warpcat said this:

    I really dig this. I’ve recently got into Processing myself, and well, decided to recreate it. Just posted some pics up on flickr:
    http://www.flickr.com/photos/warpcat/2597180052/
    Imitation is the greates form of flattery, right?
    The other stuff you’ve done is great too.
    Cheers

  6. # on 06 Oct 08 @ 10:37 Tobias Toft said this:

    Hi! Yet another imitator here! I just started learning Processing, and your work inspired me to try to recreate the Pixel Path algorithm. The result didn’t turn out as beautiful as yours, but I definitely learned a lot. Thanks!

your turn

your private data is never published or shared. required fields are marked *

metal&gin?

metal & gin is the personal blog of craig t mackenzie, a scary boy with delusions of grandeur, and a panache for geek-chic. craig lives in the UK and writes code for avenue a | razorfish. you can find out more about him in the about section.

this blog mostly focuses on matters of geekery as well as any random musing that pops into craig's head. this is also a place for meta-data about craig to be collated.