Releases: gudoshnikovn/python-libphash
Release list
v1.4.1
Update
- Update submodule to 1.10.4
- Increase accuracy
What's Changed
- release 1.4.1: Update submodule to 1.10.4 by @gudoshnikovn in #5
Full Changelog: v1.4.0...v1.4.1
v1.4.0
Summary
Major update to v1.4.0, synchronizing the Python bindings with the new libphash v1.10.1 core. This release introduces native WebP support, significantly improved error handling, and a modernized build system using uv.
Key Changes
1. Core Engine Upgrade (libphash v1.10.1)
- Native WebP Support: Integrated
libwebpas a core dependency. Decoding is now handled natively with SIMD acceleration (AVX2/NEON), making WebP decoding up to 2.5x faster than Pillow. - Modular Architecture: The C engine has been completely refactored into a modular structure (
src/image,src/loaders,src/hashes), improving maintainability and reducing the binary footprint. - Mathematical Rigor: Resolved edge-case bugs in DCT (pHash) and HSV color classification. Added dedicated rigor tests to ensure 100% hash stability across platforms.
2. Enhanced Python Integration
- Smart Exception Mapping: C-level error codes are now automatically translated into descriptive Python exceptions (e.g.,
DecodeError,InvalidArgumentError) via the newph_get_error_string()API. - Performance Optimizations:
- Radial Hash: Now 6% faster due to optimized single-precision float math.
- Memory Management: Implemented automatic scratchpad trimming in the Arena Allocator, preventing memory growth during massive batch processing.
- Linux I/O: Added
madvisehints to accelerate bulk image loading from disk.
3. Performance Benchmarks (v1.4.0 vs imagehash)
| Algorithm | Format | Speedup vs imagehash |
|---|---|---|
| pHash | JPEG | 6.76x |
| wHash | JPEG | 50.39x |
| pHash | WebP | 2.66x |
| wHash | WebP | 17.14x |
4. Infrastructure & CI/CD
- Modern Toolchain: Migrated to
uvfor lightning-fast dependency management and environment synchronization. - Testing: Achieved >95% code coverage with a restructured test suite (26+ comprehensive tests).
- Regression Tracking: New GitHub Actions workflow monitors performance to ensure no PR degrades hashing speed or quality.
What's Changed
- release: v1.10.0 - modular refactoring, WebP support, and CI/CD improvements by @gudoshnikovn in gudoshnikovn/libphash#9
- release: v1.4.0 — libphash 1.10.1 engine, Native WebP and Enhanced Errors by @gudoshnikovn in #4
Full Changelog: v1.3.3...v1.4.0
v1.3.3
Summary
Major update synchronizing the Python bindings with libphash v1.9.0. This release focuses on performance (SIMD, zero-copy), production-ready benchmarking, and robust CI/CD infrastructure.
Key Changes
1. Core Engine (libphash v1.9.0)
- Bundled Decoders: Statically linked
libjpeg-turbo,libpng, andspngfor zero-dependency runtime. - SIMD Acceleration: Enabled NEON (ARM) and SSE/AVX (x86) for image decoding and hashing.
- Zero-Copy I/O: Switched to mmap-based loading for all formats, significantly reducing memory overhead and FILE* latency.
2. API & Algorithms
- Algorithm Split: Distinct exposure and documentation for
color_hash(HSV-based) andcolor_moments_hash(statistical digest). - Corrected Types: Improved CFFI mapping for
Digesttypes to ensure memory safety. - Enhanced Configuration: Full exposure of
gamma,gray_weights, andwhashmodes.
3. Production Benchmarks
- Unified Suite: Refactored ad-hoc scripts into a structured
benchmarks/package with shared utilities. - New Tools: Added
generate_data.py,run_speed.py, andrun_quality.pywith full CLI support. - Consistency: Unified data paths under
benchmarks/data/{jpeg,png}.
4. Robust Testing
- Coverage: Expanded to 26 comprehensive tests covering:
- Thread safety (multi-threaded context access).
- Parameter tuning consistency.
- Error handling for corrupt/missing files.
- Context reuse and reloading.
5. CI/CD & Infrastructure
- cibuildwheel: Automated build-time dependency injection (
cmake,nasm) inpyproject.toml. - Project Mapping: Rewritten
Gemini.mdto serve as a high-level navigation map for the entire architecture.
What's Changed
- v1.3.0 — libphash v1.9.0 synchronization, production-ready benchmarks, and CI/CD enhancements by @gudoshnikovn in #3
Full Changelog: v1.2.0...v1.3.3
v1.2.0
Added
-
Advanced Configuration API: Extended
ImageContextwith methods for fine-tuning hashing parameters: -
set_phash_params: Configures DCT size and reduction factors for pHash. -
set_radial_params: Controls Radial Hash precision (projections and samples). -
set_block_params: Adjusts grid resolution for block-based hashes (BMH, mHash). -
set_gray_weights: Allows custom R, G, B weights for grayscale conversion. -
Digest Interface: Introduced the
Digestclass for handling multi-byte hashes (Radial, BMH, Color Hash). -
Expanded Metrics: Added support for Euclidean distance (L2) calculation in addition to standard Hamming distance within the
Digestclass.
Improved
- libphash v1.6.1 Compatibility: Updated bindings to support the latest features and thread-safe context API of the native library.
- Project Structure: Renamed
types.pytoph_types.pyto prevent namespace collisions and improve internal organization. - Documentation: Updated
README.mdwith comprehensive examples of the new configuration API and extended distance metrics.
Fixed
- Import Resolution: Fixed all internal import references in
__init__.pyandutils.pyfollowing the types module refactoring. - Memory Handling: Improved integration with the native
scratchpadto ensure efficient buffer reuse in Python environments.
What's Changed
- v1.2.0 - Version bump and updated public interfaces by @gudoshnikovn in #2
Full Changelog: v1.1.0...v1.2.0
v1.1.0
Release 1.1.0
Changes
- Updated core engine: Upgraded native
libphashto version 1.3.0 - Improved performance: Significant speed-up in hash calculations due to new lazy-loading grayscale cache and optimized DCT matrix in the C layer.
- Better accuracy: Switched to Bilinear Interpolation for image resizing, resulting in more stable and precise hashes.
Internal
- Refreshed Git submodule and rebuilt CFFI bindings to support new internal structures.
PR
- 1.1.0 by @gudoshnikovn in #1
Full Changelog: v1.0.3...1.1.0