{"id":13574229,"url":"https://github.com/tomayac/esm-potrace-wasm","last_synced_at":"2026-03-09T04:02:23.304Z","repository":{"id":42469829,"uuid":"406347502","full_name":"tomayac/esm-potrace-wasm","owner":"tomayac","description":"A modern ESM build of the Potrace library for use in the browser.","archived":false,"fork":false,"pushed_at":"2023-08-29T15:17:33.000Z","size":1703,"stargazers_count":83,"open_issues_count":7,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-27T07:51:37.399Z","etag":null,"topics":["javascript","potrace","potrace-js","potrace-port","wasm"],"latest_commit_sha":null,"homepage":"https://tomayac.github.io/esm-potrace-wasm/demo/index.html","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomayac.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":"2021-09-14T11:56:18.000Z","updated_at":"2025-09-25T00:25:46.000Z","dependencies_parsed_at":"2024-06-21T15:37:13.224Z","dependency_job_id":"837a3f93-411c-405a-aa11-085bdb8711c3","html_url":"https://github.com/tomayac/esm-potrace-wasm","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":0.3055555555555556,"last_synced_commit":"694f4f6371a7207dccc71b638ba866afe031a799"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomayac/esm-potrace-wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fesm-potrace-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fesm-potrace-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fesm-potrace-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fesm-potrace-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomayac","download_url":"https://codeload.github.com/tomayac/esm-potrace-wasm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fesm-potrace-wasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30282541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: 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":["javascript","potrace","potrace-js","potrace-port","wasm"],"created_at":"2024-08-01T15:00:48.388Z","updated_at":"2026-03-09T04:02:23.269Z","avatar_url":"https://github.com/tomayac.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# ESM Potrace Wasm\n\nA modern ESM build of the [Potrace](http://potrace.sourceforge.net/) library for use in the browser.\n\n## Installation\n\n```bash\nnpm install --save esm-potrace-wasm\n```\n\n## Usage\n\n```js\nimport { potrace, init } from 'esm-potrace-wasm';\n\n(async () =\u003e {\n  // Initialize the module once.\n  await init();\n\n  /**\n   * The `imageBitmapSource` parameter is an `ImageBitmapSource`, that is any of:\n   * - `HTMLImageElement`\n   * - `SVGImageElement`\n   * - `HTMLVideoElement`\n   * - `HTMLCanvasElement`\n   * - `ImageData`\n   * - `ImageBitmap`\n   * - `Blob`\n   */\n  const svg = await potrace(\n    imageBitmapSource,\n    (options = {\n      turdsize: 2,\n      turnpolicy: 4,\n      alphamax: 1,\n      opticurve: 1,\n      opttolerance: 0.2,\n      pathonly: false,\n      extractcolors: true,\n      posterizelevel: 2, // [1, 255]\n      posterizationalgorithm: 0, // 0: simple, 1: interpolation\n    })\n  );\n})();\n```\n\n## Developing\n\nModify `src/potrace/` and run `npm run build` to update the ESM build in `dist/`.\nThe emscripten build file is located at `./build.sh` (or `build.ps1` for Win32) respectively. A simple demo\nthat imports `dist/index.js` is available in `demo/` and can be started by running `npm start`.\n\n## Apps using this\n\nThis library is used in \u003ca href=\"https://svgco.de/\"\u003eSVGcode\u003c/a\u003e.\n\n\u003ca href=\"https://svgco.de/\"\u003e\n  \u003cimg src=\"https://github.com/tomayac/SVGcode/raw/main/public/screenshots/desktop.png\" alt=\"SVGcode application screenshot\" width=\"707\" height=\"497\" /\u003e\n\u003c/a\u003e\n\n## License\n\n⚠️ GPL-v2.0, due to the original [Potrace license](http://potrace.sourceforge.net/#license).\n\n## Acknowledgements\n\nBased on [@nturley](https://github.com/nturley)'s [fork](https://github.com/nturley/potrace-wasm) of\n[@IguteChung](https://github.com/IguteChung)'s initial [potrace-wasm](https://github.com/IguteChung/potrace-wasm).\nUnfortunately, the original author did not react on my\n[Pull Request](https://github.com/IguteChung/potrace-wasm/pull/1), so I forked.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomayac%2Fesm-potrace-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomayac%2Fesm-potrace-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomayac%2Fesm-potrace-wasm/lists"}