{"id":39538085,"url":"https://github.com/petrusmatiros/img2web","last_synced_at":"2026-01-18T06:34:42.619Z","repository":{"id":205885859,"uuid":"715325490","full_name":"petrusmatiros/img2web","owner":"petrusmatiros","description":"A CLI tool for converting bulk images to compressed, resized WEBP images","archived":false,"fork":false,"pushed_at":"2023-11-15T01:19:07.000Z","size":214972,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-11-15T12:39:05.284Z","etag":null,"topics":["image-processing","webp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/petrusmatiros.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}},"created_at":"2023-11-06T23:11:09.000Z","updated_at":"2023-11-15T12:39:05.284Z","dependencies_parsed_at":"2023-11-10T15:26:44.023Z","dependency_job_id":null,"html_url":"https://github.com/petrusmatiros/img2web","commit_stats":null,"previous_names":["petrusmatiros/img2web"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/petrusmatiros/img2web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrusmatiros%2Fimg2web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrusmatiros%2Fimg2web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrusmatiros%2Fimg2web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrusmatiros%2Fimg2web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrusmatiros","download_url":"https://codeload.github.com/petrusmatiros/img2web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrusmatiros%2Fimg2web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["image-processing","webp"],"created_at":"2026-01-18T06:34:41.719Z","updated_at":"2026-01-18T06:34:42.506Z","avatar_url":"https://github.com/petrusmatiros.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ch1 align=\"center\"\u003eimg2web\u003c/h1\u003e\n\u003c/p\u003e\n\n## Table of Contents\n- [Table of Contents](#table-of-contents)\n- [Website URL](#website-url)\n- [Project description](#project-description)\n- [Installation](#installation)\n  - [Dependencies](#dependencies)\n- [Things I've learned](#things-ive-learned)\n- [Benchmark](#benchmark)\n  - [Highest effort (6)](#highest-effort-6)\n- [Default effort (4)](#default-effort-4)\n- [Lowest effort (0)](#lowest-effort-0)\n- [Development](#development)\n\n## Website URL\n- TBD\n\n## Project description\nA CLI tool for converting bulk images to compressed, resized WEBP images\n\n\n## Installation\n```\nnpm i\nnode index.js\n```\n\n### Dependencies\n```json\n\"sharp\": \"^0.32.6\"\n```\n\n## Things I've learned\n- I was able to 2x the performance, from avg 1000ms / file, to 500ms / file, by using not getting the metadata for each file. Instead, I use the built-in fit functionality, to fit images \"inside\". This effectively \"preserves the aspect ratio and resizes the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified\" (according to the [sharp docs](https://sharp.pixelplumbing.com/api-resize))\n\n## Benchmark\n- Task: Resize, convert and compress JPG images from Unsplash to 1920x1080 WEBP images (for optimal web performance)\n- File size: 633 KB to 9033 KB\n- Dimensions: 1845x2767 to 7486x4993\n- Different orientations and aspect ratios\n- Parameters: Quality: 75, Effort: 6\n- Note: % of file reduction is the same for both versions, since the code change did not affect the compression algorithm\n\n-TL:DR, the new version is 2x faster than the old version (same amount of compression and same quality)\n\n### Highest effort (6)\n| Parameter     | Description              | Version 1                | Version 2                | Version 3                |\n|---------------|--------------------------|--------------------------|--------------------------|--------------------------|\n| Effort        | Scale: 0-6               | 6                        | 6                        | 6                        | \n| Quality       | Scale: 0-100             | 75                       | 75                       | 75                       |\n| Nr of Files   | Number of files          | 100                      | 100                      | 100                      |\n| Avg Time (ms) | Average processing time  | 1366.71                  | 510.08                   | 157.71                   |\n\n128.07ms\n110.35\n## Default effort (4)\n| Parameter     | Description              | Version 1                | Version 2                | Version 3                |\n|---------------|--------------------------|--------------------------|--------------------------|--------------------------|\n| Effort        | Scale: 0-6               | 4                        | 4                        | 4                        |\n| Quality       | Scale: 0-100             | 75                       | 75                       | 75                       |\n| Nr of Files   | Number of files          | 100                      | 100                      | 100                      |\n| Avg Time (ms) | Average processing time  | 966.16                   | 402.87                   | 128.07                   |\n\n## Lowest effort (0)\n| Parameter     | Description              | Version 1                | Version 2                | Version 3                |\n|---------------|--------------------------|--------------------------|--------------------------|--------------------------|\n| Effort        | Scale: 0-6               | 0                        | 0                        | 0                        |\n| Quality       | Scale: 0-100             | 75                       | 75                       | 75                       |\n| Nr of Files   | Number of files          | 100                      | 100                      | 100                      |\n| Avg Time (ms) | Average processing time  | 714.79                   | 337.76                   | 110.35                   |\n\n  \n## Development\nTo get a development build, run `npm run dev`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrusmatiros%2Fimg2web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrusmatiros%2Fimg2web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrusmatiros%2Fimg2web/lists"}