{"id":19217080,"url":"https://github.com/8ctopus/webp8","last_synced_at":"2025-10-10T02:14:59.377Z","repository":{"id":45810655,"uuid":"276860960","full_name":"8ctopus/webp8","owner":"8ctopus","description":"command line tool to convert images to webp format","archived":false,"fork":false,"pushed_at":"2024-11-15T04:51:59.000Z","size":11615,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-30T08:49:10.420Z","etag":null,"topics":["command-line-tool","php","webp"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/8ctopus.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,"zenodo":null}},"created_at":"2020-07-03T09:28:38.000Z","updated_at":"2024-11-15T04:51:57.000Z","dependencies_parsed_at":"2025-05-12T23:57:46.066Z","dependency_job_id":null,"html_url":"https://github.com/8ctopus/webp8","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/8ctopus/webp8","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fwebp8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fwebp8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fwebp8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fwebp8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8ctopus","download_url":"https://codeload.github.com/8ctopus/webp8/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8ctopus%2Fwebp8/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002539,"owners_count":26083399,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":["command-line-tool","php","webp"],"created_at":"2024-11-09T14:20:02.348Z","updated_at":"2025-10-10T02:14:59.359Z","avatar_url":"https://github.com/8ctopus.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webp8\n\n[![license](https://poser.pugx.org/8ctopus/webp8/license)](https://packagist.org/packages/8ctopus/webp8)\n![lines of code](https://raw.githubusercontent.com/8ctopus/webp8/image-data/lines.svg)\n\nwebp8 is a command line tool to convert images to webp format\n\n## how to install\n\nYou have the choice between:\n- composer install `composer require 8ctopus/webp8`\n- download the phar\n- or build it yourself\n\n```sh\ncurl -LO https://github.com/8ctopus/webp8/releases/download/1.1.0/webp8.phar\n\n# check hash against the one published under releases\nsha256sum webp8.phar\n\n# make phar executable\nchmod +x webp8.phar\n\n# rename phar (from here on optional)\nmv webp8.phar webp8\n\n# move phar to /usr/local/bin/ (optional)\nmv webp8 /usr/local/bin/\n```\n\n### Windows only\n\n- download and extract cwebp.exe from [libwebp](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.0-windows-x64.zip)\n- add `cwebp.exe` to PATH (`sysdm.cpl` -\u003e `Advanced` -\u003e `Environment Variables`)\n- download webp8\n\n```cmd\ncurl -LO https://github.com/8ctopus/webp8/releases/download/1.1.0/webp8.phar\n```\n\n- check hash against the one published under releases\n\n## convert images to webp\n\n```sh\n./webp8 convert [--cwebp_m] [-cwebp_q] [--cwebp_z] [--multithreading] directory\n\n[▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 15843/15843 (100%) -   1 hr/1 hr   - 6.0 MiB\n\n[OK]\n\n------- ----------- --------- ------------- ------- --------------- -----------\n total   converted   skipped   webp bigger   time    size original   size webp\n------- ----------- --------- ------------- ------- --------------- -----------\n 15843   15843       0         235           64:20   1.2 GB          150.3 MB\n------- ----------- --------- ------------- ------- --------------- -----------\n```\n\n*NOTE*: converted images that are bigger in webp format are automatically deleted since the whole point is to get smaller images. You can see the bigger images in the `webp bigger` column.\n\n## delete existing webp images\n\n```sh\n./webp8 cleanup [--dry-run] [-v] directory\n```\n\n# htaccess code to show webp instead of png/jpg when browser supports\n\nCode adapted from [webp-express](https://github.com/rosell-dk/webp-express)\n\n```.htaccess\nRewriteEngine On\n\n# redirect images to webp when possible\n# check if browser accepts webp\nRewriteCond %{HTTP_ACCEPT} image/webp\n\n# check if requested file is jpg or png\nRewriteCond %{REQUEST_FILENAME} \\.(jpe?g|png)$\n\n# check if webp for image exists\nRewriteCond %{REQUEST_FILENAME}\\.webp -f\n\n# serve webp image instead\nRewriteRule . %{REQUEST_FILENAME}\\.webp [T=image/webp,E=EXISTING:1,E=ADDVARY:1,L]\n\n# make sure that browsers which do not support webp also get the Vary:Accept header\n# when requesting images that would be redirected to existing webp on browsers that does.\nSetEnvIf Request_URI \"\\.(jpe?g|png)$\" ADDVARY\n\n# Apache appends \"REDIRECT_\" in front of the environment variables defined in mod_rewrite, but LiteSpeed does not.\n# So, the next lines are for Apache, in order to set environment variables without \"REDIRECT_\"\nSetEnvIf REDIRECT_EXISTING 1 EXISTING=1\nSetEnvIf REDIRECT_ADDVARY 1 ADDVARY=1\n\n# Set Vary:Accept header for the image types handled by WebP Express.\n# The purpose is to make proxies and CDNs aware that the response varies with the Accept header.\nHeader append \"Vary\" \"Accept\" env=ADDVARY\n```\n\n## for development\n\n### build phar\n\n    ./build.sh\n\n### debug code\n\n    php src/EntryPoint.php convert -- images\n\n    # cleanup test dir\n    git clean -xfd images\n\n# improvement ideas\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8ctopus%2Fwebp8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8ctopus%2Fwebp8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8ctopus%2Fwebp8/lists"}