static void assertBWImagesIdentical(BWImage a, BWImage b) { int w = a.getWidth(), h = a.getHeight(); assertEquals("Width", w, b.getWidth()); assertEquals("Height", h, b.getHeight()); for y to h: for x to w: { byte b1 = a.getByte(x, y), b2 = b.getByte(x, y); if (b1 != b2) fail("Pixel at " + x + "/" + y + ": " + b1 + " vs " + b2); } }