code: public static boolean compareTile(int tw, int th, ImageBuffer a, int xa, int ya, ImageBuffer b, int xb, int yb)
      {
          for (int x = 0; x < tw; x++)
          {
              for (int y = 0; y < th; y++)
              {
                  final int colorA = a.getRgb(x + xa, y + ya);
                  final int colorB = b.getRgb(x + xb, y + yb);
  
                  if (colorA != colorB)
                  {
                      return false;
                  }
              }
          }
          return true;
      }
docs: Compare two tiles by checking all pixels.
  
  @param tw The tile width.
  @param th The tile height.
  @param a The first tile image.
  @param xa The location x.
  @param ya The location y.
  @param b The second tile image.
  @param xb The location x.
  @param yb The location y.
  @return <code>true</code> if equals, <code>false</code> else.