{"id":21304946,"url":"https://github.com/maximilianmairinger/imageweb","last_synced_at":"2026-02-22T18:37:01.790Z","repository":{"id":57272185,"uuid":"326074524","full_name":"maximilianMairinger/imageWeb","owner":"maximilianMairinger","description":"Image optimisation and compression for the web.","archived":false,"fork":false,"pushed_at":"2025-02-25T18:34:57.000Z","size":14970,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T18:47:52.344Z","etag":null,"topics":["compression","image","img","min","minification","optimisation","picture","web"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/image-web","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximilianMairinger.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":"2021-01-01T23:36:50.000Z","updated_at":"2025-02-25T18:35:00.000Z","dependencies_parsed_at":"2024-10-23T10:08:11.404Z","dependency_job_id":"bff8c0b3-82bd-44ca-b3e7-e5a916ba557c","html_url":"https://github.com/maximilianMairinger/imageWeb","commit_stats":{"total_commits":150,"total_committers":1,"mean_commits":150.0,"dds":0.0,"last_synced_commit":"e322bf980f731c5fd989cf963adb3fd4d134a7f7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maximilianMairinger/imageWeb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2FimageWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2FimageWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2FimageWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2FimageWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximilianMairinger","download_url":"https://codeload.github.com/maximilianMairinger/imageWeb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2FimageWeb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264902116,"owners_count":23680999,"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":["compression","image","img","min","minification","optimisation","picture","web"],"created_at":"2024-11-21T16:16:26.702Z","updated_at":"2025-10-23T21:29:50.125Z","avatar_url":"https://github.com/maximilianMairinger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web image\n\nImage optimization and compression for the web. Bulk resize and compress them for dynamic resource deployment. Intended for preload images, thumbnails, client dependent compression algorithms (avif for browsers that support it), end device dependent resolution (\n\n\n\nscreen =\u003e 4K image)\n\n## Installation\n\n```shell\n $ npx image-web --help\n```\n\n## Usage\n\nTake files from `src/res/img` compress them (as `avif`, `webp` and `jpg` in `UHD`, `FHD`, `PREV`) and pipes them to `dist/res/img` properly named (e.g. `image-name@UHD.webp`).\n\n### CLI\n\n```shell\n $ image-web src/res/img dist/res/img\n```\n\nThe options are analog the the ones available to the API. Please view `image-web --help` for a comprehensive list. Here an example with options:\n\n```shell\n $ image-web src/res/img dist/res/img --algorithm avif,webp --resolution QHD,SD\n $ image-web src/res/img dist/res/img -a avif,webp -r 2160p,1080p,15p\n```\n\nAnother example: Sanitize/recodec a single image (UHD resolution, codec infered by output file type):\n\n```shell\n $ image-web src/res/img/image-name.png dist/res/img/image-name.webp\n```\n\n### API\n\n```ts\nimport imageWeb from \"web-image\"\n\nimageWeb(\"src/res/img\", \"dist/res/img\")\n```\n\n#### Options\n\nBy default, the compression algorithms generally produce images at different visual fidelity (avif looks, despite being much better, worse than jpg at the same resolution). Web image tries to mitigate this issue by scaling up the resolution dynamically, depending on the algorithm used. You may disable this behavior like this\n\n```ts\nimport imageWeb from \"web-image\"\n\nimageWeb(\"src/res/img\", \"dist/res/img\", { silent: false, dynamicResolution: false })\n```\n\nThe default export is a basic configured instance. For custom configurations: \n\n```ts\nimport { constrImageWeb } from \"web-image\"\n\nconst imageWeb = constrImageWeb([\"avif\", \"webp\", \"jpg\"], [\n  \"FHD\",  // Common resolution (explained below)\n  508960, // Total pixels (width * height)\n  { pixels: 508960, name: \"littleMoreThanSD\" }, // name is used as suffix replacing the resolution (filename e.g. img@littleMoreThanSD.avif)\n  { width: 2000 } // interpolates width or height in 16:9 ratio to pixels\n])\n\nimageWeb(\"src/res/img\", \"dist/res/img\")\n```\n\nOptions can be given here too. Those will be applied to all instance calls, when not overwritten.\n\n```ts\nimport { constrImageWeb } from \"web-image\"\n\nconst imageWeb = constrImageWeb([\"avif\", \"jpg\"], [\n  \"FHD\"\n], { silent: false, dynamicResolution: true })\n```\n\n##### Supported algorithms\n\navif, webp, jpg, tiff \u0026 png are supported by the underling library [sharp](https://www.npmjs.com/package/sharp).\n\n##### Common resolutions\n\nTranslation table for common resolutions to total pixels (width * height)\n\n```ts\nexport const imageResolutions = {\n  \"2UHD\": 7680 * 4320, // 4320p\n  \"UHD\": 3840 * 2160, // 2160p\n  \"QHD\": 2560 * 1440, // 1440p\n  \"FHD\": 1920 * 1080, // 1080p\n  \"HD\": 1280 * 720, // 720p\n  \"SD\": 640 * 480, // 480p\n  \"LD\": 320 * 240, // 240p\n  \"TINY\": 256 * 144, // 144p\n  \"PREV\": 25 * 15 // 15p \n}\n```\n\n## Contribute\n\nAll feedback is appreciated. Create a pull request or write an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilianmairinger%2Fimageweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximilianmairinger%2Fimageweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilianmairinger%2Fimageweb/lists"}