Integrate imagehash to pytest #259
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds configurable hash methods for pytest-mpl’s hash comparison mode and switches perceptual hashing to use the ImageHash library. A new mpl-hash- method option is available via CLI, INI, and the mpl_image_compare decorator (hash_method=), with sha256 remaining the default for backward compatibility. When a non‑SHA method is selected, hashes are computed through ImageHash (e.g., phash, ahash, dhash, whash, colorhash, etc.), and those methods are restricted to raster formats (PNG) to avoid invalid usage with vector formats.The implementation removes the custom pHash code path and centralizes hash method validation and computation in the plugin. Documentation is updated to describe the new configuration option and to clarify that alternative hash methods are supported. A new test exercises hash_method="phash" to verify that perceptual hashes are generated correctly. The project now includes an optional hashes extra that installs ImageHash and its supporting dependencies for users who want perceptual hashes.
Closes #150 #146 #21