{"id":19184501,"url":"https://github.com/9am/img-victor","last_synced_at":"2025-05-08T00:04:09.283Z","repository":{"id":57681222,"uuid":"470450977","full_name":"9am/img-victor","owner":"9am","description":"A web component converting \u003cimg\u003e to SVG \u003cpath\u003e with a drawing effect 🏆","archived":false,"fork":false,"pushed_at":"2023-04-23T06:27:49.000Z","size":110,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T00:02:21.498Z","etag":null,"topics":["animation","img","lsd","webcomponents"],"latest_commit_sha":null,"homepage":"","language":"C","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/9am.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,"zenodo":null}},"created_at":"2022-03-16T05:53:56.000Z","updated_at":"2024-11-05T07:13:05.000Z","dependencies_parsed_at":"2025-04-20T05:30:52.891Z","dependency_job_id":"9ad4a322-f4a6-493e-a586-d269185e768c","html_url":"https://github.com/9am/img-victor","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/9am%2Fimg-victor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9am%2Fimg-victor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9am%2Fimg-victor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9am%2Fimg-victor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9am","download_url":"https://codeload.github.com/9am/img-victor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973681,"owners_count":21834107,"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":["animation","img","lsd","webcomponents"],"created_at":"2024-11-09T11:07:23.093Z","updated_at":"2025-05-08T00:04:09.195Z","avatar_url":"https://github.com/9am.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"https://user-images.githubusercontent.com/1435457/159866255-e15e4d8c-437d-48aa-a27e-a751cc02e7c2.svg\" alt=\"img-victor\" width=\"180\" height=\"180\" /\u003e\n\t\u003ch1\u003e\u0026lt;img-victor\u0026gt;\u003c/h1\u003e\n\t\u003cp\u003eA web component converting \u0026lt;img\u0026gt; to SVG \u0026lt;path\u0026gt; with a drawing effect\u003c/p\u003e\n    \u003cp\u003e\n        \u003ca href=\"https://github.com/9am/img-victor/blob/main/LICENSE\"\u003e\n            \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/9am/img-victor?style=flat-square\u0026color=success\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://www.npmjs.com/package/@9am/img-victor\"\u003e\n            \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/@9am/img-victor?style=flat-square\u0026color=orange\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://www.npmjs.com/package/@9am/img-victor\"\u003e\n            \u003cimg allt=\"npm\" src=\"https://img.shields.io/npm/dt/@9am/img-victor?style=flat-square\u0026color=blue\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://bundlephobia.com/package/@9am/img-victor@latest\"\u003e\n            \u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@9am/img-victor?style=flat-square\"\u003e\n        \u003c/a\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n## Demo\n\u003cimg src=\"https://user-images.githubusercontent.com/1435457/233823342-d76e050e-e52c-4270-9009-e67d6b91ff3a.gif\" alt=\"img-victor-demo-manual\" /\u003e\n\n## Usage\n1. Installation\n\n\t```\n\tnpm install @9am/img-victor\n\t```\n2. ESM\n\n\t```js\n\timport { register } from '@9am/img-victor';\n\tregister({/* options */})\n\n\t// html\n\t\u003cimg-victor src=\"/img.png\"\u003e\u003c/img-victor\u003e\n\t```\n\n## Documentation\n\n### Attributes\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|`src`|{String}|**Required** if `data-src` unset|The image URL|\n|`data-src`|{String}|**Required** if `src` unset|The lazy-loading `src`|\n|`title`|{String}|`''`|For screen readers|\n|`ratio`|{String}|`'1:1'`|`${width}:${height}` to prevent reflow before iamge loading|\n|`manual`|{Boolean}|`false`|When `manual` is true, img-victor will not draw automatically, it could be done by toggle the className `active`|\n\n### CSS property\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|`--victor-stroke`|css \\\u003ccolor\u003e|`dimgray`|svg path stroke color|\n|`--victor-stroke-width`|css \\\u003clength\u003e|`0.3%`|svg path stroke width|\n|`--victor-stroke-linecap`|`{butt\\|round\\|square\\|inherit}`|`round`|svg path stroke linecap|\n|`--victor-stroke-linejoin`|`{arcs\\|bevel\\|miter\\|miter-clip\\|round}`|`round`|svg path stroke linejoin |\n|`--victor-duration`|`css \u003ctransition-duration\u003e`|`3200ms`|transition duration|\n|`--victor-timing-function`|`css \u003ctransition-timing-function\u003e`|`ease-in-out`|transition timing function|\n|`--victor-filter`|`css \u003cfilter\u003e`|`custom brush`|path filter|\n\n### Register Options\n\n|Name|Type|Default|Description|\n|:--:|:--:|:-----:|:----------|\n|`tagName`|{String}|`img-victor`|Change tag name of the web component|\n|`worker`|{Worker}|`LSD worker`|The worker plugin.\u003c/br\u003e1. Write your own worker.js like:\u003c/br\u003e```onmessage({ data:ImageData }) =\u003e postMessage([, groupOfLines])```\u003c/br\u003e2. Using a faster version LSD worker, example can be found in `index.html`\u003c/br\u003e*Notice: you need to bundle and serve `fastWorker.js` and  `fastWorker.wasm`.*|\n|`poolSize`|{Number}|`2`|Worker pool size|\n\n## Development\n1. Install dependencies\n\n\t`npm install`\n2. Install `emcc`\n\n\t[emscripten.org](https://emscripten.org/docs/getting_started/downloads.html)\n3. Build worker\n\n\t`npm run build:all`\n4. Start dev server\n\n\t`npm run dev`\n5. Put images under `./demo/img`, replace image URL in `index.html`\n6. Open `localhost:3000` in browser\n\n## References\nThe LSD worker in this component is compiled from the C version of [LSD: a Line Segment Detector\nRafael Grompone von Gioi, Jérémie Jakubowicz, Jean-Michel Morel, Gregory Randall](http://www.ipol.im/pub/art/2012/gjmr-lsd/) by [Emscripten](https://emscripten.org/index.html).\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9am%2Fimg-victor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9am%2Fimg-victor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9am%2Fimg-victor/lists"}