{"id":19732200,"url":"https://github.com/ytetsuro/image-hash","last_synced_at":"2025-04-30T02:31:54.787Z","repository":{"id":37796255,"uuid":"204292729","full_name":"ytetsuro/image-hash","owner":"ytetsuro","description":"Image to dhash for Browser","archived":false,"fork":false,"pushed_at":"2023-01-06T02:06:20.000Z","size":1437,"stargazers_count":3,"open_issues_count":12,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T15:12:32.335Z","etag":null,"topics":["dhash","hacktoberfest","imagediff","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ytetsuro.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}},"created_at":"2019-08-25T12:42:57.000Z","updated_at":"2024-10-14T19:19:55.000Z","dependencies_parsed_at":"2023-02-05T02:30:56.400Z","dependency_job_id":null,"html_url":"https://github.com/ytetsuro/image-hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytetsuro%2Fimage-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytetsuro%2Fimage-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytetsuro%2Fimage-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytetsuro%2Fimage-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytetsuro","download_url":"https://codeload.github.com/ytetsuro/image-hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251629186,"owners_count":21618115,"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","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":["dhash","hacktoberfest","imagediff","typescript"],"created_at":"2024-11-12T00:25:14.318Z","updated_at":"2025-04-30T02:31:54.312Z","avatar_url":"https://github.com/ytetsuro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ytetsuro/image-hash.svg?branch=master)](https://travis-ci.org/ytetsuro/image-hash)\n[![codecov](https://codecov.io/gh/ytetsuro/image-hash/branch/master/graph/badge.svg)](https://codecov.io/gh/ytetsuro/image-hash)\n\n# Browser image hash\n\nThis is browser image hash generator.\n\nThis library is made to generate the same hash as [image-hash](https://github.com/JohannesBuchner/imagehash) as much as possible.\n\n## Supported.\n\n* difference hashing ([dHash](http://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html))\n\n## Feature Suuport.\n\n* average hashing ([aHash](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html))\n* perception hashing ([pHash](http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html))\n* wavelet hashing ([wHash](https://fullstackml.com/2016/07/02/wavelet-image-hash-in-python/))\n\n## Installation\n\n```bash\n$ npm install browser-image-hash\n```\n\n## Basic Using\n\n```typescript\nimport {DifferenceHashBuilder, Hash} from 'browser-image-hash';\n\ndocument.addEventListener('DOMContentLoaded', async () =\u003e {\n  const builder = new DifferenceHashBuilder();\n  const targetURL = new URL('./example.jpg', window.location.href);\n  const destHash = await builder.build(targetURL);\n  const srcHash = new Hash('0111011001110000011110010101101100110011000100110101101000111000');\n\n  if (srcHash.getHammingDistance(destHash) \u003c= 10) {\n     console.log('Resembles');\n     return;\n  }\n\n  console.log('Different');\n});\n```\n\n⚠️ Since this library uses canvas, please be careful of the same origin policy.\n\n[Allowing cross-origin use of images and canvas](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytetsuro%2Fimage-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytetsuro%2Fimage-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytetsuro%2Fimage-hash/lists"}