{"_id":"@btheegg-kimth/gif2webp","_rev":"8-b2c24f5f6250234844a8ef946453e78b","name":"@btheegg-kimth/gif2webp","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.1":{"name":"@btheegg-kimth/gif2webp","version":"0.0.1","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"author":{"name":"btheegg-kimth"},"license":"MIT","_id":"@btheegg-kimth/gif2webp@0.0.1","maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"dist":{"shasum":"187dd2c59e016b3104c6481a5d8ac0f2e1c4d87e","tarball":"https://registry.npmjs.org/@btheegg-kimth/gif2webp/-/gif2webp-0.0.1.tgz","fileCount":10,"integrity":"sha512-K4y7egTGH3+FZ1WfI6VTTNxuHI9s16n40YGk5OmmE8LIvQbmRrzkjbgB7Rtxpw8UT2WSPQJHi8wyn2r79DX9Gg==","signatures":[{"sig":"MEUCIFSxIaunm3b0Is0Uja3cI5ke5OE8z4QCs1aMCKJlzciNAiEAj392BUzDJNkTs0y5VJGXABcI+2R0GgTXF1A2DdveK+g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":522579},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./package.json":"./package.json"},"gitHead":"5e84ae243f69cbf26f3baa6d3a22f0e4e6dc21f9","scripts":{"build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kth32105","email":"kimth32105@gmail.com"},"deprecated":"브라우저에서 동작 안 \n  함(pthread), 0.0.3 사용","repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"_npmVersion":"10.9.2","description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"unrun":"^0.3.0","tsdown":"^0.22.0","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/gif2webp_0.0.1_1779928427908_0.023868955538453696","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@btheegg-kimth/gif2webp","version":"0.0.2","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"author":{"name":"btheegg-kimth"},"license":"MIT","_id":"@btheegg-kimth/gif2webp@0.0.2","maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"dist":{"shasum":"65ba0f87c682d196b209af53800643a19de2dce8","tarball":"https://registry.npmjs.org/@btheegg-kimth/gif2webp/-/gif2webp-0.0.2.tgz","fileCount":9,"integrity":"sha512-Rrzj8WObdPLOp4xrYI9J/pKX/6RfXKOfTH0h1AIRxlZSHOxGJstc5WILH4f4FYUt5ogYfrQ6zllwnqO/R+Z3SQ==","signatures":[{"sig":"MEQCIFSLzLnnM6FwkOswA8441oXG0Hz1iaIMqFEM9tblAEIhAiAtZVjq0q7QlgfgxxRbbNEHmJbFYuVr2owsVb+awQxVnA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":632812},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./package.json":"./package.json"},"gitHead":"5a479b6128d061ac0b6239920b59356483dad176","scripts":{"build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kth32105","email":"kimth32105@gmail.com"},"deprecated":"소비자 vite에 \n  optimizeDeps.exclude 필요, 0.0.3은 불필요","repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"_npmVersion":"10.9.2","description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"unrun":"^0.3.0","tsdown":"^0.22.0","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/gif2webp_0.0.2_1779935622960_0.993524012920938","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@btheegg-kimth/gif2webp","version":"0.0.3","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"author":{"name":"btheegg-kimth"},"license":"MIT","_id":"@btheegg-kimth/gif2webp@0.0.3","maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"dist":{"shasum":"72ac4d8b1a0f7e8ad84ddd385f252f24d7a413e7","tarball":"https://registry.npmjs.org/@btheegg-kimth/gif2webp/-/gif2webp-0.0.3.tgz","fileCount":9,"integrity":"sha512-FA2/1BW3I0H+TcE4Tz5AvNXPA1inQpjMcljl4jxxRRMYpk93/fPsAlC06rHBPIHHGoJELGv4UMHpFb8tZtAqSg==","signatures":[{"sig":"MEQCICL2hNxxU8aiaVNx9U4vAeeus/GtS6g720fegXs7EXLhAiAQCgIE/zyPlS/4zQ6NDb28YeB9FL6sBGGU36E5/WOVtQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":631467},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./package.json":"./package.json"},"gitHead":"12b0797661ead9071d708c57f15cee7e883036f8","scripts":{"build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kth32105","email":"kimth32105@gmail.com"},"repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"_npmVersion":"10.9.2","description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"unrun":"^0.3.0","tsdown":"^0.22.0","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/gif2webp_0.0.3_1779940555717_0.33647073126157223","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@btheegg-kimth/gif2webp","version":"0.0.4","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"author":{"name":"btheegg-kimth"},"license":"MIT","_id":"@btheegg-kimth/gif2webp@0.0.4","maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"dist":{"shasum":"fee7bab4e38fa17d605c6991c13bb5df54c8733d","tarball":"https://registry.npmjs.org/@btheegg-kimth/gif2webp/-/gif2webp-0.0.4.tgz","fileCount":9,"integrity":"sha512-ph2rKjeApAN8i846ZgkhHD0YY58Hvare4NWs1c1nD+kDO3yLjorm1ksr++WJYZFh0nrfvEF41LwCdHHPySGOPA==","signatures":[{"sig":"MEYCIQDc+fl3VSe3PxOY8CxaLsyU/n/Pz3MU4IgcPYUtJgDN9gIhAPSfRh0Y/zCXce3IDSI/BBHrSB4yYAMb1GQDlSjZbuOZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCEz8xmHuhM3cgT6nifmyva/2VfAqYVg058A9zjXcCAugIgYONXrLlWj7Nyh9rUFLWSKI2wv7GWYJvURuA8iz+Uvzw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":638746},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./package.json":"./package.json"},"gitHead":"34b0bda0cb3aae013d7ba19565947d9950480695","scripts":{"build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kth32105","email":"kimth32105@gmail.com"},"repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"_npmVersion":"11.16.0","description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"unrun":"^0.3.0","tsdown":"^0.22.0","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/gif2webp_0.0.4_1790906126172_0.00063076780199256","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@btheegg-kimth/gif2webp","version":"0.0.5","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"author":{"name":"btheegg-kimth"},"license":"MIT","_id":"@btheegg-kimth/gif2webp@0.0.5","maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"dist":{"shasum":"12d17eeb0faeacbb4bd7e0214859e2bdf69bbc22","tarball":"https://registry.npmjs.org/@btheegg-kimth/gif2webp/-/gif2webp-0.0.5.tgz","fileCount":9,"integrity":"sha512-M1uod9DLRy21hCVEaoZJxwE2yrl6A2C9xlf5wYZVpLSJP9GOD1k0KWon9rABoBy2uPeURbvlLA+2FYrbYnbH+w==","signatures":[{"sig":"MEYCIQD9I82g1nTyLotq1evrJjisu3T2QQDPcoVaJu6Ck3zezAIhAOu6BDcMmlgJMAxWmytHLlOcHJZvvU1W24kYgxa13P6g","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIA//j4FXpq681QVQ0z1W2qbPWR0UaA1T95WST3l0ZOrnAiAcl3t2Jnng6vVR9nF4ykEk5Lw5pebkjYbE0v0qzZ8uuQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":639869},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./package.json":"./package.json"},"gitHead":"3b1f2b1405ddf598759a7775e088e65e1b654d85","scripts":{"build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kth32105","email":"kimth32105@gmail.com"},"repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"_npmVersion":"11.16.0","description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"unrun":"^0.3.0","tsdown":"^0.22.0","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/gif2webp_0.0.5_1790907758651_0.24869224486273378","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"_id":"@btheegg-kimth/gif2webp@0.0.6","bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"dist":{"shasum":"609b2701efe878cd72acfbba6de6297a33ade711","tarball":"https://registry.npmjs.org/@btheegg-kimth/gif2webp/-/gif2webp-0.0.6.tgz","fileCount":15,"integrity":"sha512-smA64qu7MqDeK+gZbRrjx5w7n11w7bq64pQNMBvHOP2BbjNle6VnkFRZ1llJhFxFk+6vF/SdeBDr/bVKB4ZYsg==","signatures":[{"sig":"MEQCIDUIKqE/VypiehrCUKjY0rSeghQ/MLQFjjzxRKmaFmu5AiBfelXCjjQalI1fWZExGC0i04ulUvU48DIQERCJ7SIoxg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCPRMQg5QDYG8IYaZilEujcEtqCBkfmS9qmOPvEZaB0dAIhAKACH+ggKvQPfGzNZSD4T34HToyIYfl3kbtrbb8bXfAM"}],"unpackedSize":655214},"main":"./dist/index.mjs","name":"@btheegg-kimth/gif2webp","type":"module","types":"./dist/index.d.mts","author":{"name":"btheegg-kimth"},"module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"},"./worker":{"types":"./dist/worker.d.mts","import":"./dist/worker.mjs"},"./package.json":"./package.json","./worker-entry":{"types":"./dist/worker-entry.d.mts","import":"./dist/worker-entry.mjs"}},"gitHead":"e3148f94297f4d0006bb8f92a2d271382bfc51cc","license":"MIT","scripts":{"build":"tsdown","typecheck":"tsc --noEmit"},"version":"0.0.6","_npmUser":{"name":"kth32105","email":"kimth32105@gmail.com"},"homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"_npmVersion":"11.16.0","description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","directories":{},"maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"sideEffects":["./dist/worker-entry.mjs"],"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"worker":["./dist/worker.d.mts"],"worker-entry":["./dist/worker-entry.d.mts"]}},"_hasShrinkwrap":false,"devDependencies":{"unrun":"^0.3.0","tsdown":"^0.22.0","typescript":"^6.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gif2webp_0.0.6_1790913875309_0.21359049977725397"}}},"time":{"created":"2026-05-28T00:33:47.731Z","modified":"2026-10-02T04:04:35.661Z","0.0.1":"2026-05-28T00:33:48.083Z","0.0.2":"2026-05-28T02:33:43.148Z","0.0.3":"2026-05-28T03:55:55.887Z","0.0.4":"2026-10-02T01:55:26.256Z","0.0.5":"2026-10-02T02:22:38.772Z","0.0.6":"2026-10-02T04:04:35.455Z"},"bugs":{"url":"https://github.com/horororok/webp-tools/issues"},"author":{"name":"btheegg-kimth"},"license":"MIT","homepage":"https://github.com/horororok/webp-tools/tree/main/packages/gif2webp","keywords":["webp","gif","gif2webp","libwebp","wasm","animation","browser"],"repository":{"url":"git+https://github.com/horororok/webp-tools.git","type":"git","directory":"packages/gif2webp"},"description":"Animated GIF -> animated WebP in the browser, via libwebp gif2webp compiled to WASM.","maintainers":[{"name":"kth32105","email":"kimth32105@gmail.com"}],"readme":"# @btheegg-kimth/gif2webp\n\n**애니메이션 GIF → 애니메이션 WebP**, 브라우저에서, libwebp를 WASM으로 컴파일해 수행.\n\n이건 브라우저가 *못 하는* 유일한 WebP 변환입니다 — `<canvas>`는 GIF의 첫 프레임만\n그려서 애니메이션을 잃습니다. 정적 JPG/PNG → WebP는 이미\n`canvas.toBlob('image/webp')`가 처리하니, 그 용도로는 이 패키지가 필요 없습니다.\n\n## 설치\n\n```sh\npnpm add @btheegg-kimth/gif2webp\n```\n\n## 사용법\n\n```ts\nimport { gif2webp } from \"@btheegg-kimth/gif2webp\";\n\nconst gifBytes = new Uint8Array(await file.arrayBuffer());\nconst webpBytes = await gif2webp(gifBytes, { mixed: true, quality: 75 });\n\n// 해상도 상한을 걸고 싶다면 (긴 변 1920, 작은 GIF는 그대로)\nconst capped = await gif2webp(gifBytes, {\n  mixed: true,\n  quality: 75,\n  resize: { width: 1920, height: 1920 },\n});\n\nconst blob = new Blob([webpBytes], { type: \"image/webp\" });\n// ...presigned URL로 S3에 업로드 등\n```\n\n### 워커에서 변환 (페이지 멈춤 방지)\n\n위 `gif2webp()`는 변환하는 동안 메인 스레드를 막습니다. 큰 GIF는 몇 초씩 페이지 전체가\n멈춥니다. import 경로만 바꾸면 같은 함수가 Web Worker에서 돌아갑니다.\n\n```ts\nimport { gif2webp } from \"@btheegg-kimth/gif2webp/worker\";\n\nconst webpBytes = await gif2webp(gifBytes, { lossy: true, resize: { width: 1920, height: 1920 } });\n```\n\n- 시그니처, 옵션, 결과는 메인 스레드용과 같습니다. 실패(잘못된 입력, 옵션 오류, 워커\n  로드 실패)는 전부 reject로 돌아옵니다.\n- 워커와 wasm은 **첫 호출 때** 만들어지고 받아집니다. import만으로는 아무것도 받지\n  않습니다.\n- 번들러 호환 (npm에서 설치한 상태로 실측):\n\n  | 번들러 | build | dev |\n  |---|---|---|\n  | Vite 8 | 설정 없이 동작 | 설정 없이 동작 |\n  | Vite 5~7 | 설정 없이 동작 | `optimizeDeps.exclude` 필요 (아래) |\n  | webpack 5 | 설정 없이 동작 | — |\n\n  Vite 7 이하 dev 서버는 의존성을 미리 번들링하면서 패키지 안 워커 파일의 경로를 잃습니다.\n  vite.config에 한 줄을 추가하세요. 빠뜨리면 변환이 \"워커 오류\"로 reject되고, 에러\n  메시지에 이 안내가 함께 나옵니다.\n\n  ```ts\n  export default defineConfig({\n    optimizeDeps: { exclude: [\"@btheegg-kimth/gif2webp\"] },\n  });\n  ```\n- 실측(2400×1080, 20프레임, Chrome): 메인 스레드 최대 멈춤이 4,179 ms에서 33 ms로\n  줄었습니다. 결과 바이트는 메인 스레드 변환과 같습니다.\n- 입력은 기본적으로 복사해서 넘깁니다(5 MB에 1 ms 미만). 원본 바이트를 다시 쓸 일이\n  없으면 `{ transfer: true }`로 복사 없이 넘길 수 있지만, 그러면 호출 후 `gifBytes`가\n  비어 버립니다(detach). `gifBytes`가 더 큰 버퍼의 일부(view)면 다른 데이터를 지키려고\n  복사로 처리합니다.\n\n#### 워커 수명\n\n- 마지막 작업이 끝나고 **30초** 동안 요청이 없으면 워커를 자동으로 종료해 메모리를\n  돌려줍니다. 새 요청이 오면 타이머가 다시 시작되고, 대기열에 작업이 남아 있으면\n  종료하지 않습니다. 종료된 뒤 호출하면 워커를 새로 만듭니다(wasm 초기화가 다시 일어남).\n- 대기 시간은 `configureGif2WebpWorker({ idleTimeoutMs })`로 바꿉니다. `0`이면 대기열이\n  비는 즉시 종료하고, `Infinity`면 자동 종료하지 않습니다.\n- `terminateGif2WebpWorker()`로 바로 종료할 수 있습니다(예: 로그아웃). 진행 중이거나\n  대기 중인 변환은 reject됩니다.\n- 종료나 워커 오류로 끊긴 변환은 항상 reject됩니다. 응답 없이 계속 기다리는 일은 없습니다.\n\n```ts\nimport { configureGif2WebpWorker, terminateGif2WebpWorker } from \"@btheegg-kimth/gif2webp/worker\";\n\nconfigureGif2WebpWorker({ idleTimeoutMs: 10_000 }); // 10초로 단축\n// 로그아웃 시\nterminateGif2WebpWorker();\n```\n\n번들러가 패키지 안의 워커를 처리하지 못하면, 워커 파일을 직접 두고 연결할 수 있습니다.\n이 경우 워커는 직접 만든 것이라 자동 종료하지 않으니, 다 쓰면 `conv.terminate()`를\n호출하세요.\n\n```ts\n// gif2webp.worker.ts\nimport \"@btheegg-kimth/gif2webp/worker-entry\";\n\n// 사용하는 쪽\nimport { createGif2WebpWorker } from \"@btheegg-kimth/gif2webp/worker\";\nconst conv = createGif2WebpWorker(\n  new Worker(new URL(\"./gif2webp.worker.ts\", import.meta.url), { type: \"module\" }),\n);\nawait conv.gif2webp(gifBytes, { lossy: true });\n```\n\n### 옵션\n\n`gif2webp` CLI 플래그에 매핑. 아무 옵션도 안 주면 `{ quality: 75 }`, 인코딩은 gif2webp\n기본값인 lossless입니다.\n\n| 옵션 | 플래그 | 비고 |\n|------|--------|------|\n| `quality` | `-q` | 0..100, 기본 75 |\n| `method` | `-m` | 0..6, 높을수록 느리고 작음 |\n| `mixed` | `-mixed` | 프레임별 lossy/lossless |\n| `lossy` | `-lossy` | |\n| `lossless` | — | 기본값이라 플래그 없음. `lossy`/`mixed`와 같이 주면 에러 |\n| `minimizeSize` | `-min_size` | |\n| `metadata` | `-metadata` | `all` \\| `none` \\| `icc` \\| `xmp` |\n| `loopCount` | `-loop_count` (패치) | 0 = 무한. 생략하면 GIF 값을 따름 |\n| `resize` | `-resize` (패치) | 아래 참고 |\n| `extraArgs` | — | 원시 전달 |\n\n### 리사이즈\n\n애니메이션을 유지한 채 캔버스 크기를 바꿉니다. 업스트림 gif2webp에는 없는 기능이라\n`build/patches/gif2webp.patch`로 추가했습니다.\n\n```ts\n// 긴 변 1920 상한: 넘으면 비율 유지하며 축소, 작으면 그대로\nawait gif2webp(bytes, { lossy: true, quality: 75, resize: { width: 1920, height: 1920 } });\n\n// 너비만 800 상한\nawait gif2webp(bytes, { lossy: true, resize: { width: 800 } });\n\n// 정확히 640×640 (비율 무시, 확대 허용)\nawait gif2webp(bytes, { resize: { width: 640, height: 640, fit: \"fill\", withoutEnlargement: false } });\n```\n\n| 필드 | 기본 | 의미 |\n|------|------|------|\n| `width` / `height` | — | 목표 크기(px). 하나는 필수, 생략한 쪽은 비율 유지 |\n| `fit` | `\"inside\"` | `\"inside\"`: 박스 안에 비율 유지 · `\"fill\"`: 정확히 width×height |\n| `withoutEnlargement` | `true` | 어느 한 변이라도 커지게 되면 리사이즈하지 않음 |\n\n#### 예시\n\n`{ lossy: true, quality: 75, resize: { width: 640, height: 640 } }`\n\n| 입력 GIF · 1280×720 · 596 KB | 출력 WebP · 640×360 · 177 KB |\n|:---:|:---:|\n| <img src=\"https://raw.githubusercontent.com/horororok/webp-tools/main/packages/gif2webp/docs/demo.gif\" width=\"360\" alt=\"입력 GIF 1280×720\"> | <img src=\"https://raw.githubusercontent.com/horororok/webp-tools/main/packages/gif2webp/docs/demo-resized.webp\" width=\"360\" alt=\"출력 WebP 640×360\"> |\n\n20프레임 애니메이션이 그대로 유지됩니다. 같은 옵션에서 리사이즈만 빼면 1280×720,\n503 KB입니다. 출력 이미지는 이 패키지의 wasm으로 브라우저(Chrome)에서 직접 변환한\n결과입니다(`docs/` 폴더, npm 패키지에는 포함되지 않음).\n\n> 축소하면 보간 때문에 GIF 팔레트에 없던 색이 생겨서, 기본 lossless 인코딩에서는\n> 결과가 **오히려 커질 수 있습니다**. 리사이즈할 때는 `lossy: true` 또는\n> `mixed: true`를 함께 쓰세요.\n\n## 비고\n\n- WASM은 단일 `.mjs`에 인라인돼 있으며(`SINGLE_FILE=1`), 첫 호출 때 lazy 로드됩\n  니다. 업로드 경로에서만 `gif2webp`를 import하면 메인 번들이 부풀지 않습니다.\n- **pthread 비활성** 빌드이므로 COOP/COEP 헤더, SharedArrayBuffer 등 추가 요구사\n  항 없음 — Vite/Webpack/Next 등 일반 환경에서 그대로 동작.\n- 호출은 내부 mutex로 직렬화 — `Promise.all`로 여러 GIF를 동시 변환해도 안전\n  (워커 버전도 같음).\n- libwebp(BSD-3-Clause) + giflib(MIT)로 빌드됨. `THIRD_PARTY_LICENSES.md` 참고.\n- 래퍼 코드는 MIT.\n","readmeFilename":"README.md"}