float row = 40;
float col = 40;
float wX = width/row;
float wY = height/col;
float xoff = 0;
for (int y = 0; y < col; y++) {
beginShape();
for (int x = 0; x < row; x++) {
color c = p.get(int(x*wX), int(y*wY));
float br = map(brightness(c), 0, 255, 3, 0.01);
float nn = map(noise(xoff), 0, 1, -0.9, 0.9);
float incx = (br);
float incy = (-br);
xoff+=2;
if (br < 2.1) { //only draw the vertices if the pixel brightness is above a certain value
curveVertex(x*wX, y*wY);
curveVertex((x+incx)*wX, (y+(incy+nn))*wY);
}
}
The result can then be exported as an SVG and printed with a pen plotter.