PImage img; img = loadImage("sample.jpg"); size(800, 597); imageMode(CENTER); noFill(); background(255); for( int i = 0; i < img.height; i++ ){ beginShape(); for( int j = 0; j < img.width; j++ ){ color c = img.get(j,i); float gray = (red(c)+green(c)+blue(c))/3; stroke(0,0,0,100); vertex(j,i-gray/10.0); } endShape(); }