Here you can find the source of compareBufferedImages(BufferedImage bufferedImage1, BufferedImage bufferedImage2)
public static boolean compareBufferedImages(BufferedImage bufferedImage1, BufferedImage bufferedImage2)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; public class Main { public static boolean compareBufferedImages(BufferedImage bufferedImage1, BufferedImage bufferedImage2) { if (bufferedImage1.getWidth() == bufferedImage2.getWidth() && bufferedImage1.getHeight() == bufferedImage2.getHeight()) { for (int x = 0; x < bufferedImage1.getWidth(); x++) { for (int y = 0; y < bufferedImage1.getHeight(); y++) { if (bufferedImage1.getRGB(x, y) != bufferedImage2.getRGB(x, y)) return false; }/* ww w . j a v a 2s . co m*/ } } else { return false; } return true; } }