int [] xd = { 0,1,1,1,0,-1,-1,-1,0}; //neighbors’ x index cw (top) int [] yd = { 1,1,0,-1,-1,-1,0,1,1}; //neighbors’ y index cw (top) PImage MyImage = loadImage("stockholm.jpg"); //load an image size(MyImage.width,MyImage.height); //size to match the image image(MyImage, 0,0); //display the image int [][] MyCopy = new int[width][height]; // array equal to image for(int x=1; x128) //case 2 a++; } if((b>=2 && b<=6) || a==1 ) MyCopy[x][y]=1; //mark these ones as edges else MyCopy[x][y]=0; } for(int x=1; x