private static int[] findFirstDiff(BufferedImage image1, PixImage image2,
                                    int border) {
    if (image1.getWidth() != image2.getWidth() ||
        image1.getHeight() != image2.getHeight()) {
      return new int[] { -1, -1 };
    }
    BufferedImage bImage2 = ImageUtils.pixImage2buffer(image2);
    for (int y = border; y < image1.getHeight() - border; y++) {
      for (int x = border; x < image1.getWidth() - border; x++) {
        if (image1.getRGB(x, y) != bImage2.getRGB(x, y)) {
          return new int[] { x, y };
        }
      }
    }
    return null;
  }