static BWImage img_bw_hdiff(BWImage a) { int w = a.w()-1, h = a.h(); BWImage b = new BWImage(w, h); for y to h: for x to w: b.setPixel(x, y, Math.abs(a.getPixel(x, y)-a.getPixel(x+1, y))); ret b; }