sbool imagesIdentical(BufferedImage img1, BufferedImage 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; var gp1 = grabbableIntPixels_fastOrSlow(img1); var gp2 = grabbableIntPixels_fastOrSlow(img2); int[] pixels1 = gp1.data, pixels2 = gp2.data; int scanlineExtra1 = gp1.scanlineStride-w; int scanlineExtra2 = gp2.scanlineStride-w; int i1 = gp1.offset, i2 = gp2.offset; var ping = pingSource(); for y to h: { for x to w: if (pixels1[i1++] != pixels2[i2++]) false; i1 += scanlineExtra1; i2 += scanlineExtra2; ping?!; } true; }