static BWImage bwFoldImage(BWImage big, BWImage pat) { int wp = pat.getWidth(), hp = pat.getHeight(); int w = big.getWidth(), h = big.getHeight(); BWImage out = new(w-wp, h-hp); for (int y = 0; y < h-hp; y++) for (int x = 0; x < w-wp; x++) out.setPixel(x, y, bwImageSectionsSimilarity2(big, pat, x, y, 0)); ret out; }