sbool binaryImagesIdentical(IBinaryImage img1, IBinaryImage img2) { if (img1 == img2) true; if (img1 == null) ret img2 == null; if (img2 == null) false; int w = img1.getWidth(), h = img1.getHeight(); if (w != img2.getWidth() || h != img2.getHeight()) false; ret binaryImagesIdentical(img1.toImage2B(), img2.toImage2B()); } sbool binaryImagesIdentical(Image2B img1, Image2B img2) { if (img1 == img2) true; if (img1 == null) ret img2 == null; if (img2 == null) false; int w = img1.getWidth(), h = img1.getHeight(); if (w != img2.getWidth() || h != img2.getHeight()) false; byte[] pixels1 = img1.pixels, pixels2 = img2.pixels; ret Arrays.equals(pixels1, pixels2); }