deltaPixels pixels which are different, the two images will be considered differentdeltaPixels value is a number of pixels or a percentage
URL fileA = ... URL fileB = ... ImagesComparator comparator = new ImagesComparator(); ImagesComparator.Result result = comparator.compareImages(fileA, fileB); boolean isEqual = result.isEquals(); // true if the two images are strictly equalTo compare two image files to check that no more than 50 pixels are different:
URL fileA = ... URL fileB = ... ImagesComparator comparator = new ImagesComparator(); ImagesComparator.Params params = comparator.getParams(); params.deltaPixels = 50; ImagesComparator.Result result = comparator.compareImages(fileA, fileB); boolean isEqual = result.isEquals(); // true if no more than 50 pixels are different
Copyright 2006-2024 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences