Skip to content

Instantly share code, notes, and snippets.

@HalfdanJ
Last active August 29, 2015 14:07
Show Gist options
  • Save HalfdanJ/5946085441276d9eb396 to your computer and use it in GitHub Desktop.
Save HalfdanJ/5946085441276d9eb396 to your computer and use it in GitHub Desktop.

Radical Computation homework

For the first Radical Computation class @sfpc with Ramsey we where asked to write some code to generate one of the images of the Great Artist

I chose the image above, and I choose to write the code in a none existing code. I knew that i could do this in oF or processing, but thought it would be funny to try and do it without the limitations of libraries. So the code cannot run anywhere but in your head.

create canvas 64x64 pixels with white background

//Draw the green drips
create 64 pixels with x position 0...64 and y position 0
  set their weight to a random number 20...60

  take the last pixel
    set the weight to 64

  do the following until the weight is less than zero
    draw green on the canvas on the position
    move 1 down on the y axis
    decrement the weight with 1

//Remove some of the green
do the following on all pixels that are green
  do the following randomly with a probability of 10%
    draw white on the position


//Draw the black drips
create 64 pixels with x position 0...64 and y position 0
  set their weight to a random number 10...40

  take the first pixel
    set the weight to 55

  do the following until the weight is less than zero
    draw black on the canvas on the position
    move 1 down on the y axis
    decrement the weight with 1


upscale the canvas to 128x128 pixels

run a blur with a radius of 2 pixels

do the following on every 2nd line of the canvas
  do the following on every pixel
    set the brightness (b) to round(3 * b)/3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment