[−][src]Function raster::compare::equal
pub fn equal(image1: &Image, image2: &Image) -> RasterResult<bool>
Compare if two images are equal. It will compare if the two images are of the same width and height. If the dimensions differ, it will return false. If the dimensions are equal, it will loop through each pixels. If one of the pixel don't match, it will return false. The pixels are compared using their RGB (Red, Green, Blue) values.
Examples
use raster::compare; let image1 = raster::open("tests/in/sample.png").unwrap(); let image2 = raster::open("tests/in/sample.png").unwrap(); let equal = compare::equal(&image1, &image2).unwrap(); assert_eq!(true, equal);