{"id":19635495,"url":"https://github.com/henrygd/optimize","last_synced_at":"2026-03-05T13:03:01.771Z","repository":{"id":222339675,"uuid":"756965837","full_name":"henrygd/optimize","owner":"henrygd","description":"Super fast cross-platform bulk image optimization with docker and libvips","archived":false,"fork":false,"pushed_at":"2025-10-28T03:37:51.000Z","size":343,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-30T17:47:36.004Z","etag":null,"topics":["avif","bun","docker","image-optimization","image-processing","libvips","webp"],"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/henrygd.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}},"created_at":"2024-02-13T16:44:53.000Z","updated_at":"2025-10-28T03:37:55.000Z","dependencies_parsed_at":"2024-06-12T22:11:49.573Z","dependency_job_id":"23807de7-420a-4bd1-a4c2-824fd9edd310","html_url":"https://github.com/henrygd/optimize","commit_stats":null,"previous_names":["henrygd/optimize"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/henrygd/optimize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrygd%2Foptimize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrygd%2Foptimize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrygd%2Foptimize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrygd%2Foptimize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henrygd","download_url":"https://codeload.github.com/henrygd/optimize/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henrygd%2Foptimize/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30127218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","bun","docker","image-optimization","image-processing","libvips","webp"],"created_at":"2024-11-11T12:25:34.184Z","updated_at":"2026-03-05T13:03:01.750Z","avatar_url":"https://github.com/henrygd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dockerized script to bulk optimize images using [libvips](https://github.com/libvips/libvips) / [sharp](https://github.com/lovell/sharp) / [bun](https://bun.sh).\n\n![example terminal command output: Total: 23.74MB saved from 8 images](assets/example.gif)\n\n## Modes\n\n`overwrite`: Overwrite existing images (default). Scans the directory mounted to `/images`.\n\n```\ndocker run --rm -v ./images:/images -v ./backup:/backup henrygd/optimize\n```\n\n---\n\n`restore`: Restore original images from backup (reverses last `overwrite` operation).\n\n```\ndocker run --rm -v ./images:/images -v ./backup:/backup -e MODE=restore henrygd/optimize\n```\n\n---\n\n`copy`: Write images to different directory. This example converts all images to WEBP.\n\n```\ndocker run --rm -v ./images:/images -v ./optimized:/optimized -e MODE=copy -e FORMAT=webp henrygd/optimize\n```\n\n## Environment Variables\n\n| Name       | Mode | Description                         | Default                             |\n| ---------- | ---- | ----------------------------------- | ----------------------------------- |\n| EXTENSIONS | \\*   | Extensions to optimize[^extensions] | jpg,jpeg,png,webp,tif,tiff          |\n| FIT        | \\*   | [Fit method](#fit-methods)          | inside                              |\n| FORMAT     | copy | Output format[^format]              | unset                               |\n| JOBS       | \\*   | Number of parallel conversion jobs  | Based on available CPU cores[^jobs] |\n| MAX_AGE    | \\*   | Age threshold in hours[^age]        | unset                               |\n| MAX_HEIGHT | \\*   | Max height of output image          | 4000                                |\n| MAX_WIDTH  | \\*   | Max width of output image           | 4000                                |\n| MIN_SIZE   | \\*   | Size threshold in kilobytes[^size]  | unset                               |\n| MODE       | \\*   | [Mode](#modes)                      | overwrite                           |\n| OWNER      | \\*   | Ownership of new files[^owner]      | root:root                           |\n| QUALITY    | \\*   | Output quality                      | 80                                  |\n| QUIET      | \\*   | Log only errors, not every file     | unset                               |\n\n## Fit Methods\n\n- `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified.\n- `cover`: Crop to cover both provided dimensions.\n- `contain`: Embed within both provided dimensions.\n- `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions.\n- `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.\n\n[^extensions]: Uppercase versions of extensions are added automatically.\n[^size]: Images are only optimized if they are larger than `MIN_SIZE`. For example, `800` would only optimize images larger than 800kB.\n[^age]: Images are only optimized if its file content was modififed in the last `MAX_AGE` hours. For example, `24` would only optimize images updated in the last 24 hours.\n[^owner]: This applies only to newly created files. Overwritten files should maintain existing permissions. Value should use IDs. For example: `-e OWNER=1000:1000`, or `-e OWNER=\"$(id -u):$(id -g)\"`.\n[^format]: This will force all optimized images to be converted to the specified format. Possible values: `webp`, `avif`.\n[^jobs]: Default `JOBS` value is one fewer than half of your available cores. If you have 16 cores, it's 7 jobs. If you have 4 cores or fewer, it's only one job.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenrygd%2Foptimize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenrygd%2Foptimize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenrygd%2Foptimize/lists"}