{"id":35807033,"url":"https://github.com/gudoshnikovn/libphash","last_synced_at":"2026-02-23T05:03:09.182Z","repository":{"id":339261384,"uuid":"1129643756","full_name":"gudoshnikovn/libphash","owner":"gudoshnikovn","description":"A high-performance, portable C library for Perceptual Hashing. Designed for image similarity detection with zero external dependencies (except for the included `stb_image`).","archived":false,"fork":false,"pushed_at":"2026-02-18T22:41:44.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-19T00:31:38.917Z","etag":null,"topics":["lib","library","perceptual-hashing"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gudoshnikovn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-07T11:29:15.000Z","updated_at":"2026-02-18T22:21:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gudoshnikovn/libphash","commit_stats":null,"previous_names":["gudoshnikovn/libphash"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/gudoshnikovn/libphash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gudoshnikovn%2Flibphash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gudoshnikovn%2Flibphash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gudoshnikovn%2Flibphash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gudoshnikovn%2Flibphash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gudoshnikovn","download_url":"https://codeload.github.com/gudoshnikovn/libphash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gudoshnikovn%2Flibphash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T04:51:08.365Z","status":"ssl_error","status_checked_at":"2026-02-23T04:49:15.865Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lib","library","perceptual-hashing"],"created_at":"2026-01-07T13:15:51.202Z","updated_at":"2026-02-23T05:03:09.177Z","avatar_url":"https://github.com/gudoshnikovn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libphash\n\nA high-performance, portable C library for Perceptual Image Hashing. \n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Core Features\n\n- **Multiple Algorithms**: `aHash`, `dHash`, `pHash` (DCT), `wHash` (Wavelet), `mHash`, `BMH`, `Radial`, and `ColorHash`.\n- **High-Performance Decoders**: Bundled support for `libjpeg-turbo`, `libpng`, and `spng` with SIMD acceleration (NEON/SSE).\n- **Fast Grayscale Loading**: Native decoders can perform grayscale conversion during decompression, saving time and memory.\n- **Zero-Allocation Processing**: Uses a context-based scratchpad for internal operations.\n- **FFI-Friendly**: Clean C API with opaque pointers, optimized for Python, Rust, or Node.js.\n- **Cross-Platform**: Optimized for ARM64 (Apple Silicon, Raspberry Pi) and x86_64.\n\n---\n\n## 🚀 Performance Modes\n\nlibphash can be built in two primary configurations:\n\n| Mode | Decoders | Dependencies | Best For |\n| :--- | :--- | :--- | :--- |\n| **High Performance** (Default) | `libjpeg-turbo`, `libpng`/`spng` | Self-contained (vendor submodules) | Production, massive datasets |\n| **Minimal** | `stb_image` (fallback) | Zero | Embedded, quick scripts |\n\n---\n\n## 🛠 Building\n\n### Recommended (CMake)\nRecommended for managing bundled high-performance decoders.\n```bash\nmkdir build \u0026\u0026 cd build\ncmake .. -DPHASH_BUILD_TESTS=ON\nmake -j$(nproc)\nctest\n```\n\n### Portable (Makefile)\nFast and simple for minimal builds.\n```bash\n# Default build (gcc)\nmake -j8\n\n# Using specific compiler\nmake CC=clang test\n```\n\n---\n\n## 📖 Documentation\n\nFor detailed technical information, see the [**Technical Documentation Index**](docs/README.md).\n- [Architecture Overview](docs/architecture.md)\n- [Development Guide \u0026 Coding Standards](docs/development.md)\n- [Algorithmic Deep Dive](docs/algorithms.md)\n\n---\n\n## 💻 Usage Example\n\n```c\n#include \u003clibphash.h\u003e\n#include \u003cstdio.h\u003e\n\nint main() {\n    ph_context_t *ctx = NULL;\n    uint64_t hash = 0;\n\n    ph_create(\u0026ctx);\n    \n    // Enable fast grayscale loading (skips RGB conversion)\n    ph_context_set_load_grayscale(ctx, 1);\n    \n    if (ph_load_from_file(ctx, \"photo.jpg\") == PH_SUCCESS) {\n        ph_compute_phash(ctx, \u0026hash);\n        printf(\"pHash: %016llx\\n\", (unsigned long long)hash);\n    }\n\n    ph_free(ctx);\n    return 0;\n}\n```\n\n## Language Bindings\n\n- **Python**: [python-libphash](https://github.com/gudoshnikovn/python-libphash) (`pip install python-libphash`)\n\n## License\n\nThis project is licensed under the MIT License.\nIncludes `stb_image`, `libjpeg-turbo`, `libpng`, and `spng` in the `vendor/` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgudoshnikovn%2Flibphash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgudoshnikovn%2Flibphash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgudoshnikovn%2Flibphash/lists"}