{"id":23192861,"url":"https://github.com/unvermuthet/waldo-lib","last_synced_at":"2025-08-18T20:33:08.783Z","repository":{"id":50537795,"uuid":"519017170","full_name":"unvermuthet/waldo-lib","owner":"unvermuthet","description":"Javascript library for fast and simple template matching without weird opencv bindings!","archived":false,"fork":false,"pushed_at":"2023-08-02T13:44:56.000Z","size":896,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-18T05:39:22.115Z","etag":null,"topics":["canvas-api","computer-vision","gpu-acceleration","image-analysis","image-recognition","javascript","javascript-library","opencv","template-matching","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unvermuthet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-07-28T23:04:32.000Z","updated_at":"2024-12-16T04:01:33.000Z","dependencies_parsed_at":"2023-12-26T05:00:12.488Z","dependency_job_id":null,"html_url":"https://github.com/unvermuthet/waldo-lib","commit_stats":{"total_commits":55,"total_committers":1,"mean_commits":55.0,"dds":0.0,"last_synced_commit":"5cb4df5cc8fb63c92881609401aba2ee4fc532d9"},"previous_names":["tinkertoe/waldo-lib"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unvermuthet%2Fwaldo-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unvermuthet%2Fwaldo-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unvermuthet%2Fwaldo-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unvermuthet%2Fwaldo-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unvermuthet","download_url":"https://codeload.github.com/unvermuthet/waldo-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230276330,"owners_count":18201089,"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":["canvas-api","computer-vision","gpu-acceleration","image-analysis","image-recognition","javascript","javascript-library","opencv","template-matching","typescript","typescript-library"],"created_at":"2024-12-18T13:09:21.640Z","updated_at":"2024-12-18T13:09:22.273Z","avatar_url":"https://github.com/unvermuthet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# waldo-lib\n\n[![npm version](https://badge.fury.io/js/waldo-lib.svg)](https://badge.fury.io/js/waldo-lib)\n\nJavascript library for fast and simple template matching without weird opencv bindings!\n\n## What is template matching?\n\n\u003e \"Template matching is a technique in digital image processing for finding small parts of an image which match a template image.\" - [wikipedia.org](https://en.wikipedia.org/w/index.php?title=Template_matching\u0026oldid=1073414135)\n\n# Quickstart\n\n```bash\n$ npm install waldo-lib\n```\n\n```typescript\nimport { Waldo, WaldoImageData, Match } from 'waldo-lib'\n\n// For browser, use context from HTMLCanvas\nconst gl = document.createElement('canvas').getContext('webgl')\n\n// For node, use headless-gl\nimport WebGL from 'gl'\nconst gl = WebGL(1, 1)\n\n\nconst waldo = new Waldo(gl)\n\nconst image: WaldoImageData = { // ImageData from Web API is asignable to WaldoImageData\n  width: 6,\n  height: 6,\n  data: Uint8ClampedArray.from([\n    0, 0, 0, 0,   0, 0, 0, 0,           0, 0, 0, 0,            0, 0, 0, 0,   0, 0, 0, 0,   0, 0, 0, 0,\n    0, 0, 0, 0,   0, 0, 0, 0,           0, 0, 0, 0,            0, 0, 0, 0,   0, 0, 0, 0,   0, 0, 0, 0,\n    0, 0, 0, 0,   255, 255, 255, 255,   255, 255, 255, 255,    0, 0, 0, 0,   0, 0, 0, 0,   0, 0, 0, 0,\n    0, 0, 0, 0,   255, 255, 255, 255,   0, 0, 0, 0,            0, 0, 0, 0,   0, 0, 0, 0,   0, 0, 0, 0,\n    0, 0, 0, 0,   0, 0, 0, 0,           0, 0, 0, 0,            0, 0, 0, 0,   0, 0, 0, 0,   0, 0, 0, 0,\n    0, 0, 0, 0,   0, 0, 0, 0,           0, 0, 0, 0,            0, 0, 0, 0,   0, 0, 0, 0,   0, 0, 0, 0,\n  ])\n}\n\nconst template: WaldoImageData = {\n  width: 2,\n  height: 2,\n  data: Uint8ClampedArray.from([\n    255, 255, 255, 255,   255, 255, 255, 255,\n    255, 255, 255, 255,   0, 0, 0, 0\n  ])\n}\n\nconst match = waldo.highestSimilarity(image, template)\nconsole.log(match)\n\n/*\n{\n  location: { x: 1, y: 2 },\n  similarity: 1, // Value goes from 0 to 1\n}\n*/\n```\n\n## How to load in ImageData\nThis library is designed to work with the [`ImageData` type from the Canvas Web API](https://developer.mozilla.org/en-US/docs/Web/API/ImageData), which is asignable to `WaldoImageData`.\n\nTo load this data from a file in NodeJS, [pngjs](https://github.com/pngjs/pngjs) could be used. See `PNG.data`, `PNG.width` and `PNG.height`.\n\n# Docs\nThe full API Documentation can be found under [https://tinkertoe.github.io/waldo-lib](https://tinkertoe.github.io/waldo-lib)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funvermuthet%2Fwaldo-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funvermuthet%2Fwaldo-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funvermuthet%2Fwaldo-lib/lists"}