{"id":16625875,"url":"https://github.com/juunini/gltf-optimizer","last_synced_at":"2025-03-16T22:30:42.637Z","repository":{"id":65779679,"uuid":"581755148","full_name":"juunini/gltf-optimizer","owner":"juunini","description":"Optimize glTF. Draco compress and convert texture to WebP.","archived":false,"fork":false,"pushed_at":"2024-04-06T04:24:24.000Z","size":25829,"stargazers_count":42,"open_issues_count":7,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T06:11:24.388Z","etag":null,"topics":["compress","glb","gltf","gltf2","optimize"],"latest_commit_sha":null,"homepage":"","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/juunini.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":"ROADMAP.md","authors":null,"dei":null}},"created_at":"2022-12-24T07:45:33.000Z","updated_at":"2025-03-01T18:32:02.000Z","dependencies_parsed_at":"2023-02-23T16:31:43.537Z","dependency_job_id":"421fd7d1-0dd1-426e-8f44-14e0ff661566","html_url":"https://github.com/juunini/gltf-optimizer","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"2a51c48de8c0c5a9a163653f04998d19732dc0c9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgltf-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgltf-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgltf-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juunini%2Fgltf-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juunini","download_url":"https://codeload.github.com/juunini/gltf-optimizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243944381,"owners_count":20372799,"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":["compress","glb","gltf","gltf2","optimize"],"created_at":"2024-10-12T04:07:36.439Z","updated_at":"2025-03-16T22:30:42.302Z","avatar_url":"https://github.com/juunini.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGLTF Optimizer\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg\n    src=\"https://repository-images.githubusercontent.com/581755148/e31793f8-a960-45f0-887e-fffe5f68677f\"\n    alt=\"\"\n    width=\"300\"\n  /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\" alt=\"TypeScript\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/GLTF-07C160?style=for-the-badge\u0026logo=gltf\u0026logoColor=white\" alt=\"GLTF\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://codecov.io/gh/juunini/gltf-optimizer\"\u003e \n    \u003cimg src=\"https://codecov.io/gh/juunini/gltf-optimizer/branch/main/graph/badge.svg?token=46CB8BN45T\" /\u003e \n  \u003c/a\u003e\n  \u003ca href=\"https://snyk.io/test/github/juunini/gltf-optimizer\"\u003e\n    \u003cimg src=\"https://snyk.io/test/github/juunini/gltf-optimizer/badge.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## [Demo](https://juunini.github.io/gltf-optimizer)\n\n## Caution\n\nOnly can compress `.glb` file now.  \nWill be support `.gltf` soon.  \n\n## Introduce\n\nOptimize glTF.  \nDraco compress and convert texture to WebP.  \n\nUsing [glTF-Transform](https://github.com/donmccurdy/glTF-Transform) and [webp-converter-browser](https://github.com/juunini/webp-converter-browser)\n\n## Install\n\n```bash\n# If you want to use CLI\nnpm install --global gltf-optimizer\n\n# npm\nnpm install gltf-optimizer\n\n# yarn\nyarn add gltf-optimizer\n\n# pnpm\npnpm add gltf-optimizer\n\n# bun\nbun add gltf-optimizer\n\n# If you install and use browser side\ncp node_modules/gltf-optimizer/draco3d/* ./\u003cyour_static_path\u003e/\n```\n\n## Usage\n\n```ts\nimport { optimizer } from 'gltf-optimizer'\n\n// ...\n\n// node (backend side)\nconst glb = fs.readFileSync('./target.glb')\nconst optimized = await optimizer.node(glb, { /* options */ })\nfs.writeFileSync('./compressed.glb', optimized)\n\n// browser (frontend side)\nconst optimized = await optimizer.web(glb, { /* options */ })\n// if using get-file-using-a-tag (https://github.com/juunini/get-file-using-a-tag)\ndownload({ fileName: 'compressed.glb', arrayBuffer: optimized })\n```\n\n## Usage(CLI)\n\n```bash\ngltf-optimizer -i model.glb\ngltf-optimizer -i model.glb -o ./output\n```\n\n## Command-Line Flags\n\n| Flag | Description | Required |\n|-|-|-|\n| `--help`, `-h` | Display help | No |\n| `--input`, `-i` | Path to the glTF or glb file. | :white_check_mark: Yes |\n| `--output`, `-o` | Output path of the glTF or glb file. Separate resources will be saved to the same directory. | No, default `./` |\n| `--emissiveStrength` | Emissive strength of the glTF file. | No, default `1.0` |\n| `--draco.method` | `edgebreaker` or `sequential` | No, default `edgebreaker` |\n| `--weld.tolerance` | Tolerance, as a fraction of primitive AABB, used when merging similar vertices. | No, default `0.0001` |\n| `--simplify.enabled` | Enable/disable vertex simplification. | No, default `true` |\n| `--simplify.ratio` | Target ratio (0-1) of vertices to keep. | No, default `0.75` |\n| `--simplify.error` | Limit on error, as a fraction of mesh radius. | No, default `0.01` |\n| `--texture.resize.resolution` | Maximum width/height to enforce, preserving aspect ratio. For example, a 4096x8192 texture, resized with limit [2048, 2048] will be reduced to 1024x2048. | No, default `1024` |\n| `--texture.resize.filter` | Resampling filter method. LANCZOS3 is sharper, LANCZOS2 is smoother. | No, default `LANCZOS3` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuunini%2Fgltf-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuunini%2Fgltf-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuunini%2Fgltf-optimizer/lists"}