//load images to be compared: BufferedImageexpectedImage= ImageComparisonUtil.readImageFromResources("expected.png"); BufferedImageactualImage= ImageComparisonUtil.readImageFromResources("actual.png");
//Create ImageComparison object and compare the images. ImageComparisonResultimageComparisonResult=newImageComparison(expectedImage, actualImage).compareImages(); //Check the result assertEquals(ImageComparisonState.MATCH, imageComparisonResult.getImageComparisonState());
//load images to be compared: BufferedImageexpectedImage= ImageComparisonUtil.readImageFromResources("expected.png"); BufferedImageactualImage= ImageComparisonUtil.readImageFromResources("actual.png"); // where to save the result (leave null if you want to see the result in the UI) FileresultDestination=newFile( "result.png" );
//Create ImageComparison object with result destination and compare the images. ImageComparisonResultimageComparisonResult=newImageComparison(expectedImage, actualImage, resultDestination).compareImages();