If the image is of a different size then the images are not equal.
If the images are of the same format then you could possibly compare scanline by scanline until you find a byte that differs (memcmp()) , or run out of bytes.
If the images are of different formats then you have to fetch the RGBA components of each pixel in turn until you find a pixel that differs, or run out of pixels.
If you look at the implementation of QImage:perator==() you'll find that this is exactly how it does it.
The reason I asked about the source is that there may be other definitions of "compare image" that are more efficient. If you are after an absolute equality then it may be adequate to check if the source files are identical at a byte level (directly our using a hash) rather than a pixel-by-pixel logical equality check.
Bookmarks