colorSearch04

Launch Java Applet: colorSearch04

When I first got into Processing I ran across some work done by Craig Mackenzie.  For whatever reason I found it quite fascinating, and wanted to try my hand at it.

In a nutshell, the sketch analyzes an image:  For a random pixel, find every other pixel in the image that is the same color, and then draw a line to it. With a bit of embellishment of course.  Furthermore, in my colorSearch sketch, I can define a specific range of colors to look for, that way the whole image isn’t analyzed.

The bulk of the work is a class I call ImageData that allows for easy querying of the color data in an image.  Notes specifically for that class over on my Processing Wiki.

Source image for the sketch

Source image for the sketch

Just starting...

Just starting...

Getting closer...

Getting closer...

Think its done...

Think it's done...

    • Ese
    • September 24th, 2013 3:56pm

    Hey Erik, I’m an ‘normal’ graphic designer, not really used to coding and stuff, my problem is to get this processing script running…

    On line 81 the debugger says:
    Random rand = new Random(); >>> “Cannot find a class or type named “Random””

    If I comment out line 81 until 88 it works, but it takes like hours (maybe normal) and doesn’t look “right”. Well, it looks pretty nifty, but not like the image you posted.. (I also used tulips.jpg)…

    You got any advice? Im running Processing 2.0.3 on an i7 w/8G Ram and Win7(64).

    Thanks!

  1. Interesting: I wrote this a number of years back (2008?), it’s possible the Processing libraries have changed slightly. That line is calling to a core Java class (Processing is based on Java) that was maybe freely available to Processing at the time, but… no longer can… for some reason. Here’s the docs on it:
    http://docs.oracle.com/javase/6/docs/api/java/util/Random.html
    I tried running some old example I code I had calling to that class, and it fails… So I’m guessing some major change has happened to the fundamental of the language.

    I’m a but rusty with my Java package imports: I would direct you to the Processing forums: Ask them how you can access this Java class in Processing, they’re usually very helpful. If you get a solution, post it up :)

  1. No trackbacks yet.