{"id":21500496,"url":"https://github.com/node-libraries/wasm-image-optimization","last_synced_at":"2025-04-05T01:05:14.807Z","repository":{"id":211820517,"uuid":"730053797","full_name":"node-libraries/wasm-image-optimization","owner":"node-libraries","description":"Optimize images with wasm on edge runtime","archived":false,"fork":false,"pushed_at":"2025-03-07T23:42:34.000Z","size":3762,"stargazers_count":79,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T00:04:47.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/node-libraries.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-11T05:20:16.000Z","updated_at":"2025-03-27T11:11:05.000Z","dependencies_parsed_at":"2024-11-23T17:42:04.660Z","dependency_job_id":"fe042b0d-2157-4df2-b01e-13698d14b5e9","html_url":"https://github.com/node-libraries/wasm-image-optimization","commit_stats":null,"previous_names":["node-libraries/wasm-image-optimization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fwasm-image-optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fwasm-image-optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fwasm-image-optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-libraries%2Fwasm-image-optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-libraries","download_url":"https://codeload.github.com/node-libraries/wasm-image-optimization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271520,"owners_count":20911587,"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":[],"created_at":"2024-11-23T17:41:56.963Z","updated_at":"2025-04-05T01:05:14.772Z","avatar_url":"https://github.com/node-libraries.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wasm-image-optimization\n\nWebAssembly is used to provide image transformation functionality.\n\n- Frontend\n\n  - Next.js (Multithreading support)\n  - React Router (Multithreading support)\n\n- Backend\n\n  - Cloudflare Workers\n  - Deno Deploy\n  - Node.js (Multithreading support)\n\n- Convert\n  - source format\n    - svg\n    - jpeg (EXIF orientation is supported)\n    - png\n    - webp\n    - avif\n  - output format\n    - jpeg\n    - png\n    - webp\n    - avif (default)\n\n## Example\n\nhttps://next-image-convert.vercel.app/  \n![](https://raw.githubusercontent.com/node-libraries/wasm-image-optimization/refs/heads/master/doc/image.webp)\n\n## Functions\n\n- Convert image\n\n```ts\noptimizeImage({\n  image: ArrayBuffer,\n  width?: number,\n  height?:number,\n  quality?: number, // quality: 1-100\n  format?: \"png\" | \"jpeg\" | \"avif\" | \"webp\" | \"none\"}\n  speed?: number // avif-speed: 0-10 (Slow-Fast, default: 6)\n  ):\n    Promise\u003c\n      ArrayBuffer\u003e\n\noptimizeImageExt({\n  image: ArrayBuffer,\n  width?: number,\n  height?:number,\n  quality?: number,\n  format?: \"png\" | \"jpeg\" | \"avif\" | \"webp\" | \"none\"}\n  speed?: number // avif-speed: 0-10 (Slow-Fast, default: 6)\n  ):\n    Promise\u003c{\n      data: Uint8Array,\n      originalWidth: number,\n      originalHeight: number,\n      width: number,\n      height: number}\u003e\n\n```\n\n- Multi Threading\n\n```ts\nwaitAll(): Promise\u003cvoid\u003e\nwaitReady(retryTime?: number) :Promise\u003cvoid\u003e\nclose(): void;\nlaunchWorker(): Promise\u003cvoid\u003e\n```\n\n## WebWorker on Vite\n\nTo use Vite, the following settings are required\n\n- vite.config.ts\n\n```ts\nimport wasmImageOptimizationPlugin from \"wasm-image-optimization/vite-plugin\";\n\nexport default defineConfig(() =\u003e ({\n  plugins: [wasmImageOptimizationPlugin()],\n}));\n```\n\n## Supported Environments\n\n- Cloudflare workers  \n  `import { optimizeImage } from 'wasm-image-optimization';`\n- Next.js (Webpack)  \n  `import { optimizeImage } from 'wasm-image-optimization/next';`\n- ESM (import base) \u0026 Deno Deploy  \n  `import { optimizeImage } from 'wasm-image-optimization';`\n- Node.js  \n  `import { optimizeImage } from 'wasm-image-optimization';`\n- Node.js(Multi thread)  \n  `import { optimizeImage } from 'wasm-image-optimization/node-worker';`\n- Vite (Browser)  \n  `import { optimizeImage } from 'wasm-image-optimization/vite';`\n- Web Worker (Browser) Multi process  \n  `import { optimizeImage } from 'wasm-image-optimization/web-worker';`\n\n## Samples\n\nhttps://github.com/SoraKumo001/wasm-image-optimization-samples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-libraries%2Fwasm-image-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-libraries%2Fwasm-image-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-libraries%2Fwasm-image-optimization/lists"}