- 
                Notifications
    
You must be signed in to change notification settings  - Fork 99
 
Description
Background
The imagehash library helps compare images by converting them into a series of numbers (hashes). It then measures how different these hashes are using a method called Hamming distance. If the hashes are similar, the images are likely similar too.
The imagehash approach is tolerant of minor differences because it focuses on the overall structure and patterns in the images rather than every tiny detail. When images are converted into hashes, small changes like slight rotations, color variations, or minor noise don't significantly alter the hash. This means that even if two images aren't exactly the same, their hashes can still be very similar, allowing the method to recognize them as alike.
See here from the official documentation.
IMPROVER acceptance testing methodology (current)
As per improver_tests/acceptance/acceptance.py, a SHA256 value is calculated using hashlib.sha256 for files that are output by the acceptance tests.  This sha is compared with a lookup (improver_tests/acceptance/SHA256SUMS).
A tolerant comparison is also made using the improver/utilities/compare.py::compare_netcdfs
Checksums checks are only ignored if environment variable IGNORE_CHECKSUMS is set as "true".
IMPROVER related documentation here.
Imagehash
- imagehash repository
 - iris graphics comparison code
 - iris graphics comparison documentation
 - iris imagehash related PRs:
 - Incorp. of imagehash into ants by me.
 - Proposal for imagehashlib incorp. into matplotlib/pytest-mpl.