Here you can find the source of equals(BufferedImage a, BufferedImage b)
public static boolean equals(BufferedImage a, BufferedImage b)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; public class Main { public static boolean equals(BufferedImage a, BufferedImage b) { int aw = a.getWidth(); int ah = a.getHeight(); int bw = b.getWidth(); int bh = b.getHeight(); if ((aw != bw) || (ah != bh)) return false; for (int y = 0; y < ah; y++) for (int x = 0; x < bw; x++) { if (a.getRGB(x, y) != b.getRGB(x, y)) { return false; }// w w w . java 2 s .c om } return true; } }