static BWImage bwAutoContrastAllRects(BWImage bw, L rects) { int h = bw.getWidth(), h = bw.getHeight(); BWImage bw2 = new BWImage(bw); for (Rect r : rects) { BWImage c = bwAutoContrast(bw.clip(r)); copyBWImage(c, 0, 0, bw2, r.x, r.y, r.w, r.h); } ret bw2; }