title: Is it possible to check if two BufferedImage are the same even if one of them is rotated?
body: <p>I would like to check in eclipse if two BufferedImages are the same or not. I am using the following method:</p>
  
  <pre><code>boolean bufferedImagesEqual(BufferedImage img1, BufferedImage img2) {
          if (img1.getWidth() == img2.getWidth() &amp;&amp; img1.getHeight() == img2.getHeight()) {
              for (int x = 0; x &lt; img1.getWidth(); x++) {
                  for (int y = 0; y &lt; img1.getHeight(); y++) {
                      if (img1.getRGB(x, y) != img2.getRGB(x, y))
                          return false;
                  }
              }
          } else {
              return false;
          }
          return true;
      }
  </code></pre>
  
  <p>It returns true if the image is not rotated. What I want to check is that if the two images has the same content (even if they are rotated in different positions). I have the idea to rotate them four times (always with 90°) and if one time they are the same the method returns true. But I don't think that it is the cleverest way to do it. Any idea?</p>