{"id":17069235,"url":"https://github.com/mogeko/fast2webp","last_synced_at":"2025-04-12T19:21:59.576Z","repository":{"id":57428442,"uuid":"160931297","full_name":"mogeko/fast2webp","owner":"mogeko","description":"一个将 PNG、JPG、JPEG、BMP、GIF 等格式的图像文件批量 (递归) 转换为 webp 格式的 Python 脚本","archived":false,"fork":false,"pushed_at":"2018-12-14T11:28:35.000Z","size":52,"stargazers_count":12,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T13:38:34.228Z","etag":null,"topics":["webp"],"latest_commit_sha":null,"homepage":"","language":"Python","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/mogeko.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2018-12-08T11:12:08.000Z","updated_at":"2024-07-09T08:01:20.000Z","dependencies_parsed_at":"2022-09-19T04:20:25.048Z","dependency_job_id":null,"html_url":"https://github.com/mogeko/fast2webp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogeko%2Ffast2webp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogeko%2Ffast2webp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogeko%2Ffast2webp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogeko%2Ffast2webp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mogeko","download_url":"https://codeload.github.com/mogeko/fast2webp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161257,"owners_count":21057553,"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":["webp"],"created_at":"2024-10-14T11:16:37.439Z","updated_at":"2025-04-12T19:21:59.552Z","avatar_url":"https://github.com/mogeko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==========\nfast2webp\n==========\n\n.. Travis build - https://github.com/Mogeko/fast2webp\n\n.. image:: https://travis-ci.org/Mogeko/fast2webp.svg?branch=master\n\t:target: https://github.com/Mogeko/fast2webp\n\t:alt: Travis build\n\n.. PyPI version — https://pypi.org/project/fast2webp\n\n.. image:: https://img.shields.io/pypi/v/fast2webp.svg\n\t:target: https://pypi.org/project/fast2webp\n\t:alt: PyPI version\n\n.. Python version — https://pypi.org/project/fast2webp\n\n.. image:: https://img.shields.io/pypi/pyversions/fast2webp.svg\n\t:target: https://pypi.org/project/fast2webp\n\t:alt: Python version\n\n\n\n一个将 PNG、JPG、JPEG、BMP、GIF 等格式的图像文件批量 (递归) 转换为 webp 格式的 Python 脚本\n\n可以设定压缩级别 (0 ~ 100)，数字越大品质越好。支持无损压缩。支持多线程。\n\n可以在 GNU/Linux 上运行，Mac OS 估计也可以 (没测试过)，Windows 上可能要修改一下才能用 (主要是目录地址中 ``/`` 与 ``\\`` 的区别)\n\n     突然发现 ``webp`` 的工具包中有一个叫 ``img2webp`` 的工具 (没用过所以不知道QAQ)，为了避免冲突现将项目改名为 ``fast2webp`` _(:з」∠)_\n\n---------\n依赖\n---------\n\n- Python3\n- webp\n\n---------\n安装\n---------\n\n::\n\n    sudo pip3 install fast2webp\n\n---------\n使用\n---------\n\n::\n\n    fast2webp [options] \u003cvalue\u003e\n\n---------\n截图\n---------\n\n.. image:: https://f.cangg.cn:82/data/201812132140465668.gif\n\n--------------\n参数 (options)\n--------------\n\n::\n\n    usage: fast2webp [-h] [-i \u003cdir\u003e] [-o \u003cdir\u003e] [-q \u003cint\u003e | -lossless][-t \u003cint\u003e] \n                    [-only {png,jpg,bmp,gif}] [-enable_gif] [-uncopy]\n\n    -i \u003cdir\u003e .......... 需要转换的文件所在的目录，会递归进行转换  (默认：.[当前目录])\n    -o \u003cdir\u003e .......... *.webp 文件的输出目录，输出目录结构与输入目录保持一致 (默认：./output)\n                        如果输出目录不存则会按照给定的路径新建文件夹\n                        如果缺省，则会在当前目录中新建并输出到目录 'output'\n    -q \u003cint\u003e .......... 与 'cwebp' 中相同；表示压缩的程度 (0 ~ 100)，数字越大品质越好 (默认：80)\n    -t \u003cint\u003e .......... 线程池中线程的个数；数字越大转换速度越快。当然，也更吃资源 (默认：10)\n    -lossless ......... 与 'cwebp' 中相同；无损压缩\n    -only \u003cvalue\u003e ..... 只执行某单一任务 (可接受的值有：png、jpg、bmp、gif)\n                        例如：-only png 表示只转换输入目录中的 png 文件为到输出目录\n    -enable_gif ....... 将 gif 转为 webp (默认情况下会跳过 gif 文件)\n                        转换 gif 文件比较吃资源，慎用\n                        转换 gif 文件不支持无损压缩，此时 -lossless = -q 100\n    -uncopy ........... 默认情况下会将非图片文件复制到输出目录中，使用参数 -uncopy 关闭这一特性\n                        (*.webp 和 *.gif 仍会被复制)\n    -h ................ 展示帮助信息\n\n---------\nTODO\n---------\n\n- 支持 Windows\n- 支持更多的参数\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmogeko%2Ffast2webp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmogeko%2Ffast2webp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmogeko%2Ffast2webp/lists"}