PImage img; img = loadImage("test.png"); size(628, 350); imageMode(CENTER); noStroke(); background(255); for( int i = 0; i < img.height; i++ ){ for( int j = 0; j < img.width; j++ ){ color c = img.get(j,i); float gray = (red(c)+green(c)+blue(c))/3; if( gray < 80 ){ gray = 0; } else{ gray = 255; } if( gray == 255 ){ stroke(red(c),green(c),blue(c)); } else{ stroke(255); } point(j, i); } }