{"id":8371,"date":"2021-07-31T22:46:27","date_gmt":"2021-07-31T14:46:27","guid":{"rendered":"https:\/\/web.xxmd.com\/?p=8371"},"modified":"2021-08-27T14:22:22","modified_gmt":"2021-08-27T06:22:22","slug":"%e4%bd%bf%e7%94%a8python%e8%84%9a%e6%9c%ac%e5%bf%ab%e9%80%9f%e5%b0%86%e5%9b%be%e7%89%87%e8%bd%ac%e6%8d%a2%e4%b8%bawebp%e6%a0%bc%e5%bc%8f%ef%bc%8cfast2webp%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/web.xxmd.com\/8371.html","title":{"rendered":"\u4f7f\u7528Python\u811a\u672c\u5feb\u901f\u5c06\u56fe\u7247\u8f6c\u6362\u4e3awebp\u683c\u5f0f\uff0cfast2webp\u4ecb\u7ecd"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u811a\u672c\u4ecb\u7ecd<\/h2>\n\n\n\n<p>\u4e00\u4e2a\u5c06 PNG\u3001JPG\u3001JPEG\u3001BMP\u3001GIF \u7b49\u683c\u5f0f\u7684\u56fe\u50cf\u6587\u4ef6\u6279\u91cf (\u9012\u5f52) \u8f6c\u6362\u4e3a webp \u683c\u5f0f\u7684 <a href=\"https:\/\/web.xxmd.com\/tag\/python\" title=\"View all posts in Python\" target=\"_blank\" class=\"tag_link\">Python<\/a> \u811a\u672c\uff1b\u53ef\u4ee5\u8bbe\u5b9a\u538b\u7f29\u7ea7\u522b (0 ~ 100)\uff0c\u6570\u5b57\u8d8a\u5927\u54c1\u8d28\u8d8a\u597d\u3002\u652f\u6301\u65e0\u635f\u538b\u7f29\u3002\u652f\u6301\u591a\u7ebf\u7a0b\u3002<\/p>\n\n\n\n<p>\u53ef\u4ee5\u5728 GNU\/Linux \u4e0a\u8fd0\u884c\uff0cMac OS \u4f30\u8ba1\u4e5f\u53ef\u4ee5 (\u6ca1\u6d4b\u8bd5\u8fc7)\uff0cWindows \u4e0a\u53ef\u80fd\u8981\u4fee\u6539\u4e00\u4e0b\u624d\u80fd\u7528 (\u4e3b\u8981\u662f\u76ee\u5f55\u5730\u5740\u4e2d&nbsp;\/&nbsp;\u4e0e&nbsp;\\&nbsp;\u7684\u533a\u522b)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u6570\u914d\u7f6e<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>PYTHON\nusage: <a href=\"https:\/\/web.xxmd.com\/tag\/fast2webp\" title=\"View all posts in fast2webp\" target=\"_blank\" class=\"tag_link\">fast2webp<\/a> &#091;-h] &#091;-i &lt;dir&gt;] &#091;-o &lt;dir&gt;] &#091;-q &lt;int&gt; | -lossless]&#091;-t &lt;int&gt;]\n                &#091;-only {png,jpg,bmp,gif}] &#091;-enable_gif] &#091;-uncopy]\n\n-i &lt;dir&gt; .......... \u9700\u8981\u8f6c\u6362\u7684\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u4f1a\u9012\u5f52\u8fdb\u884c\u8f6c\u6362  (\u9ed8\u8ba4\uff1a.&#091;\u5f53\u524d\u76ee\u5f55])\n-o &lt;dir&gt; .......... *.webp \u6587\u4ef6\u7684\u8f93\u51fa\u76ee\u5f55\uff0c\u8f93\u51fa\u76ee\u5f55\u7ed3\u6784\u4e0e\u8f93\u5165\u76ee\u5f55\u4fdd\u6301\u4e00\u81f4 (\u9ed8\u8ba4\uff1a.\/output)\n                    \u5982\u679c\u8f93\u51fa\u76ee\u5f55\u4e0d\u5b58\u5219\u4f1a\u6309\u7167\u7ed9\u5b9a\u7684\u8def\u5f84\u65b0\u5efa\u6587\u4ef6\u5939\n                    \u5982\u679c\u7f3a\u7701\uff0c\u5219\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e2d\u65b0\u5efa\u5e76\u8f93\u51fa\u5230\u76ee\u5f55 'output'\n-q &lt;int&gt; .......... \u4e0e 'cwebp' \u4e2d\u76f8\u540c\uff1b\u8868\u793a\u538b\u7f29\u7684\u7a0b\u5ea6 (0 ~ 100)\uff0c\u6570\u5b57\u8d8a\u5927\u54c1\u8d28\u8d8a\u597d (\u9ed8\u8ba4\uff1a80)\n-t &lt;int&gt; .......... \u7ebf\u7a0b\u6c60\u4e2d\u7ebf\u7a0b\u7684\u4e2a\u6570\uff1b\u6570\u5b57\u8d8a\u5927\u8f6c\u6362\u901f\u5ea6\u8d8a\u5feb\u3002\u5f53\u7136\uff0c\u4e5f\u66f4\u5403\u8d44\u6e90 (\u9ed8\u8ba4\uff1a10)\n-lossless ......... \u4e0e 'cwebp' \u4e2d\u76f8\u540c\uff1b\u65e0\u635f\u538b\u7f29\n-only &lt;value&gt; ..... \u53ea\u6267\u884c\u67d0\u5355\u4e00\u4efb\u52a1 (\u53ef\u63a5\u53d7\u7684\u503c\u6709\uff1apng\u3001jpg\u3001bmp\u3001gif)\n                    \u4f8b\u5982\uff1a-only png \u8868\u793a\u53ea\u8f6c\u6362\u8f93\u5165\u76ee\u5f55\u4e2d\u7684 png \u6587\u4ef6\u4e3a\u5230\u8f93\u51fa\u76ee\u5f55\n-enable_gif ....... \u5c06 gif \u8f6c\u4e3a webp (\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f1a\u8df3\u8fc7 gif \u6587\u4ef6)\n                    \u8f6c\u6362 gif \u6587\u4ef6\u6bd4\u8f83\u5403\u8d44\u6e90\uff0c\u614e\u7528\n                    \u8f6c\u6362 gif \u6587\u4ef6\u4e0d\u652f\u6301\u65e0\u635f\u538b\u7f29\uff0c\u6b64\u65f6 -lossless = -q 100\n-uncopy ........... \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f1a\u5c06\u975e\u56fe\u7247\u6587\u4ef6\u590d\u5236\u5230\u8f93\u51fa\u76ee\u5f55\u4e2d\uff0c\u4f7f\u7528\u53c2\u6570 -uncopy \u5173\u95ed\u8fd9\u4e00\u7279\u6027\n                    (*.webp \u548c *.gif \u4ecd\u4f1a\u88ab\u590d\u5236)\n-h ................ \u5c55\u793a\u5e2e\u52a9\u4fe1\u606f\n<\/code><\/pre>\n\n\n\n<p>\u53c2\u8003\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fast2webp -i \u6e90\u6587\u4ef6\u76ee\u5f55 -o \u8f93\u51fa\u76ee\u5f55 -q \u538b\u7f29\u7a0b\u5ea6 -t \u7ebf\u7a0b\u6570 '\/home\/xs\/\u56fe\u7247\/2020-09-13 11-45-01\u5c4f\u5e55\u622a\u56fe.png'<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f9d\u8d56<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Python3<\/li><li>webp<\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pip3 install fast2webp\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>fast2webp &#091;options] &lt;value&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u811a\u672c\u5730\u5740<\/h2>\n\n\n\n<div class=\"content-hidden\">\r\n            <div class=\"content-hidden-info\">\r\n                <div class=\"content-show-roles b2-mark\">\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u76f8\u5173\u56fe\u7247<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/web.cdn.xxmd.com\/wp-content\/uploads\/2021\/07\/1627742536-2e2d0743b24c8be.png\/avif95\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"529\" src=\"https:\/\/web.cdn.xxmd.com\/wp-content\/uploads\/2021\/07\/1627742536-2e2d0743b24c8be.png\/avif95\"  class=\"wp-image-8372\" title=\"\u4f7f\u7528Python\u811a\u672c\u5feb\u901f\u5c06\u56fe\u7247\u8f6c\u6362\u4e3awebp\u683c\u5f0f\uff0cfast2webp\u4ecb\u7ecd\u63d2\u56fe\" alt=\"\u4f7f\u7528Python\u811a\u672c\u5feb\u901f\u5c06\u56fe\u7247\u8f6c\u6362\u4e3awebp\u683c\u5f0f\uff0cfast2webp\u4ecb\u7ecd\u63d2\u56fe\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/web.cdn.xxmd.com\/wp-content\/uploads\/2021\/07\/1627742686-e3a9334be792bd2.png\/avif95\"><img loading=\"lazy\" decoding=\"async\" width=\"1158\" height=\"337\" src=\"https:\/\/web.cdn.xxmd.com\/wp-content\/uploads\/2021\/07\/1627742686-e3a9334be792bd2.png\/avif95\"  class=\"wp-image-8373\" title=\"\u4f7f\u7528Python\u811a\u672c\u5feb\u901f\u5c06\u56fe\u7247\u8f6c\u6362\u4e3awebp\u683c\u5f0f\uff0cfast2webp\u4ecb\u7ecd\u63d2\u56fe1\" alt=\"\u4f7f\u7528Python\u811a\u672c\u5feb\u901f\u5c06\u56fe\u7247\u8f6c\u6362\u4e3awebp\u683c\u5f0f\uff0cfast2webp\u4ecb\u7ecd\u63d2\u56fe1\" \/><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u811a\u672c\u4ecb\u7ecd \u4e00\u4e2a\u5c06 PNG\u3001JPG\u3001JPEG\u3001BMP\u3001GIF \u7b49\u683c\u5f0f\u7684\u56fe\u50cf\u6587\u4ef6\u6279\u91cf (\u9012\u5f52) \u8f6c\u6362\u4e3a webp \u683c\u5f0f\u7684 Python \u811a\u672c\uff1b\u53ef\u4ee5\u8bbe\u5b9a\u538b\u7f29\u7ea7\u522b (0 ~ 100)\uff0c\u6570\u5b57\u8d8a\u5927\u54c1\u8d28\u8d8a\u597d\u3002\u652f\u6301\u65e0\u635f\u538b\u7f29\u3002\u652f\u6301\u591a\u7ebf\u7a0b\u3002 \u53ef\u4ee5\u5728 GNU\/Linux \u4e0a\u8fd0\u884c\uff0cMac OS \u4f30\u8ba1\u4e5f\u53ef\u4ee5 (\u6ca1\u6d4b\u8bd5\u8fc7)\uff0cWindows \u4e0a\u53ef\u80fd\u8981\u4fee\u6539\u4e00\u4e0b\u624d\u80fd\u7528 (\u4e3b\u8981\u662f\u76ee\u5f55\u5730\u5740\u4e2d&nbsp;\/&nbsp;\u4e0e&nbsp;\\&nbsp;\u7684\u533a\u522b) \u53c2\u6570\u914d\u7f6e \u53c2\u8003\u793a\u4f8b\uff1a \u4f9d\u8d56 Python3 webp \u5b89\u88c5 \u4f7f\u7528 \u811a\u672c\u5730\u5740 \u76f8\u5173\u56fe\u7247<\/p>\n","protected":false},"author":1,"featured_media":8373,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2778],"tags":[2785,2787,2784,2782,2783,2781,2779,2780,2786],"collection":[],"class_list":{"0":"post-8371","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-python","8":"tag-fast2webp","9":"tag-python","10":"tag-webp","11":"tag-2782","12":"tag-2783","16":"tag-webppython"},"_links":{"self":[{"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/posts\/8371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/comments?post=8371"}],"version-history":[{"count":1,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/posts\/8371\/revisions"}],"predecessor-version":[{"id":10912,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/posts\/8371\/revisions\/10912"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/media\/8373"}],"wp:attachment":[{"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/media?parent=8371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/categories?post=8371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/tags?post=8371"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/web.xxmd.com\/wp-json\/wp\/v2\/collection?post=8371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}