{"id":20951195,"url":"https://github.com/lingdong-/skeletonization-js","last_synced_at":"2025-10-06T11:54:42.682Z","repository":{"id":84534802,"uuid":"171230125","full_name":"LingDong-/skeletonization-js","owner":"LingDong-","description":"Javascript implementation of image skeletonization","archived":false,"fork":false,"pushed_at":"2019-02-18T06:49:48.000Z","size":8,"stargazers_count":43,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T12:38:43.862Z","etag":null,"topics":["gpu","image-processing","opencv","opencvjs","skeletonization","webgl"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LingDong-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-18T06:49:00.000Z","updated_at":"2025-03-14T06:23:18.000Z","dependencies_parsed_at":"2023-10-20T21:17:16.712Z","dependency_job_id":null,"html_url":"https://github.com/LingDong-/skeletonization-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LingDong-/skeletonization-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LingDong-%2Fskeletonization-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LingDong-%2Fskeletonization-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LingDong-%2Fskeletonization-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LingDong-%2Fskeletonization-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LingDong-","download_url":"https://codeload.github.com/LingDong-/skeletonization-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LingDong-%2Fskeletonization-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265538546,"owners_count":23784613,"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":["gpu","image-processing","opencv","opencvjs","skeletonization","webgl"],"created_at":"2024-11-19T00:57:26.914Z","updated_at":"2025-10-06T11:54:37.646Z","avatar_url":"https://github.com/LingDong-.png","language":"JavaScript","readme":"skeletonization.js library\n=================\n\n![](https://cdn.glitch.com/51dda229-d755-451b-a499-79a1285996fa%2Fsample.png?1550470920804)\n\nGPU-powered image [skeletonization](https://en.wikipedia.org/wiki/Topological_skeleton) for the web.\n\n\nBased on [orginal C++ code by Zhang-Suen](https://web.archive.org/web/20130313084711/http://opencv-code.com/quick-tips/implementation-of-thinning-algorithm-in-opencv/).\n\nWith GPU support from [gpu.js](https://gpu.rocks/).\n\nUses [OpenCV.js](https://docs.opencv.org/3.4/d5/d10/tutorial_js_root.html).\n\nCheckout the live demo at [skeletonization-js.glitch.me](https://skeletonization-js.glitch.me).\n\n## Usage\n\nIn your HTML file:\n\n```html\n\u003c!-- Include OpenCV.js --\u003e\n\u003cscript src=\"https://docs.opencv.org/3.4/opencv.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Include gpu.js --\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/gpu.js/1.10.4/gpu.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Include skeletonization.js --\u003e\n\u003cscript src=\"https://skeletonization-js.glitch.me/skeletonization.js\"\u003e\u003c/script\u003e\n\n```\n\nIn your Javascript file:\n\n```javascript\n\n// Usage with HTML Canvas:\n\n// setup skeletonization:\nskeletonization.setup(\n  256, // output width\n  256  // output height\n);\n\n// skeletonize a canvas element specified by its id:\nskeletonization.skeletonize(\"inputCanvasId\", {\n  preprocess: true, // whether or not to preprocess the\n                    // source image (blur, threshold, etc.)\n    blur: 5,        // if preprocess, radius of blurring to apply\n    threshold: 128, // if preprocess, binary threshold to apply\n    invert: false,  // if preprocess, invert the image (foreground\n                    // should be white, background should be black)\n  outputCanvasId: \"outputCanvasId\", // id of canvas on which output\n                                    // will be displayed\n  bbox: [0,0,256,256], // bounding box (xmin,ymin,xmax,ymax) of\n                       // the region to apply skeletonization,\n                       // leave undefined to apply to whole image\n})\n\n\n```\n\nYou can also skeletonize `cv::Mat`, e.g. in an OpenCV.js project:\n\n```javascript\n\n// Usage with OpenCV.js:\n\n// setup skeletonization\nskeletonization.setup(\n  256, // output width\n  256  // output height\n);\n\n// read the image with OpenCV.js\nvar im = cv.imread(\"inputCanvasId\");\n\n// ... (custom preprocessing)\n\n// skeletonize the cv::Mat\n// skeletonize modifies the input cv::Mat,\n// so save a copy if you still need the original\nskeletonization.skeletonize(im, {\n  preprocess: true, // whether or not to preprocess the\n                    // source image (blur, threshold, etc.)\n    blur: 5,        // if preprocess, radius of blurring to apply\n    threshold: 128, // if preprocess, binary threshold to apply\n    invert: false,  // if preprocess, invert the image (foreground\n                    // should be white, background should be black)\n  bbox: [0,0,256,256], // bounding box (xmin,ymin,xmax,ymax) of\n                       // the region to apply skeletonization,\n                       // leave undefined to apply to whole image\n})\n\n// ... (custom postprocessing)\n\n// display the result\ncv.imshow(\"outputCanvasId\",im);\n\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingdong-%2Fskeletonization-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flingdong-%2Fskeletonization-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingdong-%2Fskeletonization-js/lists"}