{"id":18486796,"url":"https://github.com/343dev/optimizt","last_synced_at":"2026-01-02T10:20:16.326Z","repository":{"id":179819897,"uuid":"661981108","full_name":"343dev/optimizt","owner":"343dev","description":"CLI image optimization tool","archived":false,"fork":false,"pushed_at":"2024-03-26T06:47:54.000Z","size":2912,"stargazers_count":50,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-26T11:20:36.218Z","etag":null,"topics":["avif","gif","image-compression","jpeg","png","svg","webp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/343dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-07-04T05:33:10.000Z","updated_at":"2024-07-07T07:25:33.308Z","dependencies_parsed_at":"2024-02-01T12:46:35.500Z","dependency_job_id":"1d0be42b-aa21-4bf5-98cb-817e55ca396f","html_url":"https://github.com/343dev/optimizt","commit_stats":null,"previous_names":["343dev/optimizt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/343dev%2Foptimizt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/343dev%2Foptimizt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/343dev%2Foptimizt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/343dev%2Foptimizt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/343dev","download_url":"https://codeload.github.com/343dev/optimizt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247912804,"owners_count":21017048,"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":["avif","gif","image-compression","jpeg","png","svg","webp"],"created_at":"2024-11-06T12:49:49.831Z","updated_at":"2025-12-24T13:45:43.173Z","avatar_url":"https://github.com/343dev.png","language":"JavaScript","readme":"# @343dev/optimizt\n\n\u003cimg align=\"right\" width=\"192\" height=\"192\"\n     alt=\"Optimizt logo: OK hand sign with Mona Lisa image between the fingers\"\n     src=\"./docs/logo.png\"\u003e\n\n[![npm](https://img.shields.io/npm/v/@343dev/optimizt.svg)](https://www.npmjs.com/package/@343dev/optimizt)\n[![Docker](https://img.shields.io/docker/v/343dev/optimizt?label=Docker)](https://hub.docker.com/r/343dev/optimizt)\n\n**Optimizt** is a command-line tool that helps prepare images for the web.\n\nIt can compress PNG, JPEG, GIF, and SVG lossy or lossless, and create AVIF and WebP versions for raster images.\n\n## Rationale\n\nAs frontend developers, we have to care about pictures: compress PNG and JPEG, remove useless parts of SVG, create AVIF and WebP for modern browsers, and so on. One day, we got tired of using a bunch of apps for that, and created one tool that does everything we want.\n\n## Usage\n\nInstall:\n\n```sh\nnpm install -g @343dev/optimizt\n```\n\nOptimize!\n\n```sh\noptimizt path/to/picture.jpg\n```\n\n## Command Line Flags\n\n- `--avif` — create AVIF versions of images.\n- `--webp` — create WebP versions of images.\n- `-f, --force` — recreate AVIF and WebP versions even if they already exist.\n- `-l, --lossless` — optimize losslessly instead of lossily.\n- `-v, --verbose` — show detailed output (e.g. skipped files).\n- `-c, --config` — use a custom configuration file instead of the default.\n- `-o, --output` — write results to the specified directory.\n- `-p, --prefix` — add prefix to optimized file names.\n- `-s, --suffix` — add suffix to optimized file names.\n- `-V, --version` — display the tool version.\n- `-h, --help` — show help message.\n\n## Usage Examples\n\n```bash\n# optimize a single image\noptimizt path/to/picture.jpg\n\n# optimize multiple images losslessly\noptimizt --lossless path/to/picture.jpg path/to/another/picture.png\n\n# recursively create AVIF and WebP versions for all images in a directory\noptimizt --avif --webp path/to/directory\n\n# recursively optimize JPEG files in the current directory\nfind . -iname \\*.jpg -exec optimizt {} +\n```\n\n## Differences Between Lossy and Lossless\n\n### Lossy (Default)\n\nProvides the best balance between file size reduction and minimal visual quality loss.\n\n### Lossless (`--lossless` flag)\n\n- **AVIF/WebP**: Uses lossless compression.\n- **PNG/JPEG/GIF**: Maximizes image quality at the expense of larger file sizes.\n- **SVG**: Settings are identical in both modes.\n\n## Configuration\n\nImage processing leverages:\n\n- [sharp](https://github.com/lovell/sharp) for [JPEG](https://sharp.pixelplumbing.com/api-output#jpeg), [PNG](https://sharp.pixelplumbing.com/api-output#png), [WebP](https://sharp.pixelplumbing.com/api-output#webp), and [AVIF](https://sharp.pixelplumbing.com/api-output#avif).\n- [svgo](https://github.com/svg/svgo) for SVG.\n- [gifsicle](https://github.com/kohler/gifsicle) for GIF.\n\n\u003e [!NOTE]\n\u003e In Lossless mode for JPEG, [Guetzli](https://github.com/google/guetzli) is used. Repeated optimization may degrade visual quality.\n\nDefault settings are defined in [.optimiztrc.cjs](./.optimiztrc.cjs), which includes all supported parameters. Disable any parameter by setting it to `false`.\n\nWhen using `--config path/to/.optimiztrc.cjs`, the specified configuration file will be used. If no `--config` is provided, Optimizt searches recursively from the current directory upward for `.optimiztrc.cjs`. If none is found, defaults are applied.\n\n## Troubleshooting\n\n### Errors like “spawn guetzli ENOENT”.\n\nEnsure the [ignore-scripts](https://docs.npmjs.com/cli/v6/using-npm/config#ignore-scripts) npm option is disabled.\nDetails: [funbox/optimizt/issues/9](https://github.com/funbox/optimizt/issues/9).\n\n## Docker\n\n### Pre-Built Image\n\n```bash\n# pull latest\ndocker pull 343dev/optimizt\n\n# pull specific version\ndocker pull 343dev/optimizt:9.0.2\n```\n\n### Manual Build\n\n```bash\n# clone repository\ngit clone https://github.com/343dev/optimizt.git\ncd optimizt\n\n# build image\ndocker build --tag 343dev/optimizt .\n```\n\nAlternatively:\n\n```bash\n# build directly from GitHub\n# ignores .dockerignore (see: https://github.com/docker/cli/issues/2827)\ndocker build --tag 343dev/optimizt https://github.com/343dev/optimizt.git\n```\n\n### Run Container\n\n```bash\n# mount current directory to /src in the container\ndocker run --rm --volume $(pwd):/src 343dev/optimizt --webp ./image.png\n```\n\n## Integrations\n\nOptimizt works seamlessly with:\n\n- [JetBrains IDEs](./docs/jetbrains.md)\n- [Visual Studio Code](./docs/vscode.md)\n- [Sublime Text 3](./docs/sublime-text.md)\n- [GitHub Actions Workflow](./docs/github.md)\n\n## Articles\n\n- [anuwong.com](https://anuwong.com/blog/2023-08-21-save-tons-of-gbs-with-optimizt/) — Compress files before uploading, save tons of GBs. 🇹🇭\n- [Linux Format, Issue 277 (July 2021)](https://www.linuxformat.com/archives?issue=277#:~:text=Kitchen%20Tales%2C%20zFRAG%2C-,Optimizt,-and%20SingleFileZ.) — Optimizt is ideal for reducing the disk footprint of images without any reduction in quality.\n\n## Credits\n\nCute picture for the project was made by [Igor Garybaldi](http://pandabanda.com/).\n","funding_links":[],"categories":["Image Optimizers","Images","JavaScript"],"sub_categories":["Meetups","Emoji"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F343dev%2Foptimizt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F343dev%2Foptimizt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F343dev%2Foptimizt/lists"}