{"id":21247679,"url":"https://github.com/jasterv/imgphash","last_synced_at":"2026-03-01T19:04:36.679Z","repository":{"id":40268121,"uuid":"472270747","full_name":"JasterV/imgphash","owner":"JasterV","description":"Provide an image class that is able to calculate similarity to other images using the phash value","archived":false,"fork":false,"pushed_at":"2024-09-02T05:57:27.000Z","size":205,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-31T01:54:17.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/JasterV.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}},"created_at":"2022-03-21T09:38:15.000Z","updated_at":"2024-08-16T23:24:51.000Z","dependencies_parsed_at":"2024-06-03T12:16:44.950Z","dependency_job_id":"0ea811a7-e187-4c7a-8a3c-9482e5281214","html_url":"https://github.com/JasterV/imgphash","commit_stats":{"total_commits":43,"total_committers":4,"mean_commits":10.75,"dds":"0.39534883720930236","last_synced_commit":"81e3d1ef1b8af5a7068686d1967181fa3f2d2a42"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JasterV/imgphash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasterV%2Fimgphash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasterV%2Fimgphash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasterV%2Fimgphash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasterV%2Fimgphash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JasterV","download_url":"https://codeload.github.com/JasterV/imgphash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasterV%2Fimgphash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268500782,"owners_count":24260207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-21T02:42:10.042Z","updated_at":"2026-03-01T19:04:36.675Z","avatar_url":"https://github.com/JasterV.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to imgphash 👋\u003c/h1\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-0.6.0-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"https://github.com/JasterV/imgphash#readme\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/JasterV/imgphash/graphs/commit-activity\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/JasterV/imgphash/blob/main/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/github/license/JasterV/imgphash\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Provide an image class that is able to calculate similarity to other images using the phash value\n\n### 🏠 [Homepage](https://github.com/JasterV/imgphash#readme)\n\n## Install\n\n```sh\nnpm i imgphash\n```\n\n## Use\n\nThis module provides a class `HashImage` that you can use to hash an image and compare it\n\n- Create a `HashImage` from a url\n\n```javascript\nconst image = await HashImage.fromUrl(url1);\n```\n\n- Create a `HashImage` from a Node buffer\n\n```javascript\nconst image = new HashImage(buffer);\n```\n\n- Get the hash of 2 images and compare them\n\n```javascript\nconst image1 = await HashImage.fromUrl(url1);\nconst image2 = await HashImage.fromUrl(url2);\nconst hash1 = await image1.phash(); // PHash instance\nconst hash2 = await image2.phash();\nconst similarity = hash1.compare(hash2);\n```\n\n\u003e The hash function returns an instance of `PHash`\n\n- Or just compare 2 image objects, this is going to internally calculate their hash and use it\n\n```javascript\nconst image1 = await HashImage.fromUrl(url1);\nconst image2 = await HashImage.fromUrl(url2);\nconst similarity = await image1.compare(image2);\n```\n\n\u003e All the comparisons return a value between 0 and 1.\n\u003e 0 meaning that the images are completely different and 1 meaning they are exactly the same image\n\n## Author\n\n👤 **Victor Martinez \u003cjaster.victor@gmail.com\u003e**\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page](https://github.com/JasterV/imgphash/issues).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2022 [Victor Martinez \u003cjaster.victor@gmail.com\u003e](https://github.com/JasterV).\u003cbr /\u003e\nThis project is [MIT](https://github.com/JasterV/imgphash/blob/main/LICENSE) licensed.\n\n---\n\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasterv%2Fimgphash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasterv%2Fimgphash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasterv%2Fimgphash/lists"}