{"id":938869,"date":"2024-12-26T20:20:49","date_gmt":"2024-12-26T12:20:49","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/938869.html"},"modified":"2024-12-26T20:20:51","modified_gmt":"2024-12-26T12:20:51","slug":"%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85python-pil","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/938869.html","title":{"rendered":"\u5982\u4f55\u5b89\u88c5python pil"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25074144\/3ba6f8e1-cdb6-4e01-8735-eda057483de4.webp\" alt=\"\u5982\u4f55\u5b89\u88c5python pil\" \/><\/p>\n<p><p> <strong>\u5b89\u88c5Python PIL\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u4f7f\u7528pip\u5b89\u88c5Pillow\u3001\u786e\u4fddPython\u73af\u5883\u6b63\u786e\u914d\u7f6e\u3001\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u5e76\u5e2e\u52a9\u4f60\u89e3\u51b3\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528PIP\u5b89\u88c5Pillow<\/p>\n<\/p>\n<p><p>PIL\uff08Python Imaging Library\uff09\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u56fe\u50cf\u5904\u7406\u5e93\uff0c\u4f46\u5b83\u5df2\u7ecf\u4e0d\u518d\u66f4\u65b0\u3002Pillow\u662fPIL\u7684\u4e00\u4e2a\u5206\u652f\uff0c\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u652f\u6301\u548c\u66f4\u65b0\uff0c\u56e0\u6b64\u5efa\u8bae\u4f7f\u7528Pillow\u800c\u4e0d\u662fPIL\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5Pillow<\/strong><br \/>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u3002\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Pillow\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install Pillow<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u4e0b\u8f7d\u5e76\u5b89\u88c5Pillow\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5347\u7ea7pip\u548cPillow<\/strong><br \/>\u5982\u679c\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Pillow\u4f46\u9700\u8981\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install --upgrade pip<\/p>\n<p>pip install --upgrade Pillow<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u786e\u4fdd\u4f60\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672c\u7684pip\u548cPillow\uff0c\u907f\u514d\u4f7f\u7528\u65e7\u7248\u672c\u53ef\u80fd\u5e26\u6765\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u786e\u4fddPython\u73af\u5883\u6b63\u786e\u914d\u7f6e<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5Python\u7248\u672c<\/strong><br \/>Pillow\u652f\u6301Python 3.x\u7684\u7248\u672c\uff0c\u56e0\u6b64\u8bf7\u786e\u4fdd\u4f60\u7684Python\u7248\u672c\u6ee1\u8db3\u8981\u6c42\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u5f53\u524dPython\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u4f7f\u7528<code>python3<\/code>\u547d\u4ee4\u6765\u533a\u5206\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6e\u865a\u62df\u73af\u5883<\/strong><br \/>\u4e3a\u4e86\u907f\u514d\u4e0e\u5176\u4ed6Python\u5305\u7684\u4f9d\u8d56\u51b2\u7a81\uff0c\u5efa\u8bae\u4f7f\u7528\u865a\u62df\u73af\u5883\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m venv myenv<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5728Windows\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">myenv\\Scripts\\activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5728macOS\u548cLinux\u4e0a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">source myenv\/bin\/activate<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5Pillow\uff0c\u800c\u4e0d\u5f71\u54cd\u5168\u5c40Python\u73af\u5883\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6d4b\u8bd5Pillow\u5b89\u88c5<\/strong><br \/>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u6765\u9a8c\u8bc1Pillow\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<p>try:<\/p>\n<p>    img = Image.new(&#39;RGB&#39;, (100, 100), color = &#39;red&#39;)<\/p>\n<p>    img.show()<\/p>\n<p>    print(&quot;Pillow installed successfully!&quot;)<\/p>\n<p>except ImportError as e:<\/p>\n<p>    print(&quot;Error importing Pillow:&quot;, e)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u56fe\u50cf\u6210\u529f\u663e\u793a\uff0c\u5e76\u4e14\u6ca1\u6709\u9519\u8bef\u6d88\u606f\uff0c\u90a3\u4e48Pillow\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/strong><br \/>\u6709\u65f6\uff0c\u5b89\u88c5Pillow\u53ef\u80fd\u4f1a\u9047\u5230\u95ee\u9898\uff0c\u5982\u7f3a\u5c11\u7cfb\u7edf\u5e93\u6216\u6743\u9650\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u7f3a\u5c11\u7cfb\u7edf\u5e93<\/strong>\uff1a\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u5b89\u88c5\u4e86\u6240\u6709\u5fc5\u8981\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u5728\u67d0\u4e9bLinux\u53d1\u884c\u7248\u4e0a\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u5b89\u88c5<code>libjpeg<\/code>\u548c<code>zlib<\/code>\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5\u8fd9\u4e9b\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6743\u9650\u95ee\u9898<\/strong>\uff1a\u5982\u679c\u4f60\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u6743\u9650\u9519\u8bef\uff0c\u5c1d\u8bd5\u4ee5\u7ba1\u7406\u5458\u6216\u4f7f\u7528<code>sudo<\/code>\u547d\u4ee4\u6765\u63d0\u5347\u6743\u9650\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7cfb\u7edf\u517c\u5bb9\u6027\u95ee\u9898<\/strong>\uff1a\u786e\u4fdd\u4f60\u4f7f\u7528\u7684Python\u7248\u672c\u548c\u64cd\u4f5c\u7cfb\u7edf\u662fPillow\u652f\u6301\u7684\u7248\u672c\u3002\u53ef\u4ee5\u67e5\u770bPillow\u7684\u5b98\u65b9\u6587\u6863\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001Pillow\u7684\u57fa\u672c\u4f7f\u7528<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u52a0\u8f7d\u548c\u4fdd\u5b58\u56fe\u50cf<\/strong><br \/>Pillow\u652f\u6301\u591a\u79cd\u56fe\u50cf\u683c\u5f0f\uff0c\u5982JPEG\u3001PNG\u3001BMP\u7b49\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Pillow\u52a0\u8f7d\u548c\u4fdd\u5b58\u56fe\u50cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<h2><strong>\u52a0\u8f7d\u56fe\u50cf<\/strong><\/h2>\n<p>img = Image.open(&#39;example.jpg&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u56fe\u50cf<\/strong><\/h2>\n<p>img.save(&#39;example_copy.png&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u6307\u5b9a\u4e0d\u540c\u7684\u6587\u4ef6\u6269\u5c55\u540d\uff0c\u4f60\u53ef\u4ee5\u5728\u4e0d\u540c\u683c\u5f0f\u4e4b\u95f4\u8f6c\u6362\u56fe\u50cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u56fe\u50cf\u5904\u7406\u64cd\u4f5c<\/strong><br \/>Pillow\u63d0\u4f9b\u4e86\u591a\u79cd\u56fe\u50cf\u5904\u7406\u529f\u80fd\uff0c\u5982\u8c03\u6574\u5927\u5c0f\u3001\u88c1\u526a\u3001\u65cb\u8f6c\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8c03\u6574\u56fe\u50cf\u5927\u5c0f<\/p>\n<p>img_resized = img.resize((200, 200))<\/p>\n<h2><strong>\u88c1\u526a\u56fe\u50cf<\/strong><\/h2>\n<p>img_cropped = img.crop((50, 50, 150, 150))<\/p>\n<h2><strong>\u65cb\u8f6c\u56fe\u50cf<\/strong><\/h2>\n<p>img_rotated = img.rotate(90)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e9b\u64cd\u4f5c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u6839\u636e\u9700\u8981\u4fee\u6539\u56fe\u50cf\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5e94\u7528\u6ee4\u955c\u548c\u6548\u679c<\/strong><br \/>Pillow\u8fd8\u652f\u6301\u5e94\u7528\u6ee4\u955c\u548c\u6548\u679c\uff0c\u4f8b\u5982\u6a21\u7cca\u3001\u9510\u5316\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import ImageFilter<\/p>\n<h2><strong>\u5e94\u7528\u6a21\u7cca\u6ee4\u955c<\/strong><\/h2>\n<p>img_blurred = img.filter(ImageFilter.BLUR)<\/p>\n<h2><strong>\u5e94\u7528\u9510\u5316\u6ee4\u955c<\/strong><\/h2>\n<p>img_sharpened = img.filter(ImageFilter.SHARPEN)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u7ec4\u5408\u4e0d\u540c\u7684\u6ee4\u955c\u548c\u6548\u679c\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u51fa\u5404\u79cd\u89c6\u89c9\u6548\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u6df1\u5165\u4e86\u89e3Pillow\u7684\u9ad8\u7ea7\u529f\u80fd<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5904\u7406\u900f\u660e\u5ea6\u548cAlpha\u901a\u9053<\/strong><br \/>Pillow\u652f\u6301\u5904\u7406\u5e26\u6709\u900f\u660e\u5ea6\u7684\u56fe\u50cf\u683c\u5f0f\uff0c\u5982PNG\u3002\u4f60\u53ef\u4ee5\u8bbf\u95ee\u548c\u4fee\u6539\u56fe\u50cf\u7684Alpha\u901a\u9053\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">img_with_alpha = Image.open(&#39;transparent.png&#39;)<\/p>\n<p>alpha = img_with_alpha.getchannel(&#39;A&#39;)<\/p>\n<h2><strong>\u4fee\u6539Alpha\u901a\u9053<\/strong><\/h2>\n<p>new_alpha = alpha.point(lambda p: p * 0.5)<\/p>\n<p>img_with_alpha.putalpha(new_alpha)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5141\u8bb8\u4f60\u8c03\u6574\u56fe\u50cf\u7684\u900f\u660e\u5ea6\u6216\u521b\u5efa\u900f\u660e\u6548\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u56fe\u50cf\u5143\u6570\u636e<\/strong><br \/>\u56fe\u50cf\u901a\u5e38\u5305\u542b\u5143\u6570\u636e\uff0c\u5982EXIF\u4fe1\u606f\u3002Pillow\u53ef\u4ee5\u5e2e\u52a9\u4f60\u8bbf\u95ee\u548c\u4fee\u6539\u8fd9\u4e9b\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">exif_data = img._getexif()<\/p>\n<p>for tag, value in exif_data.items():<\/p>\n<p>    tag_name = Image.ExifTags.TAGS.get(tag, tag)<\/p>\n<p>    print(f&quot;{tag_name}: {value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u4fe1\u606f\u6765\u4e86\u89e3\u56fe\u50cf\u7684\u62cd\u6444\u6761\u4ef6\u6216\u4fee\u6539\u5143\u6570\u636e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6279\u91cf\u5904\u7406\u56fe\u50cf<\/strong><br \/>Pillow\u53ef\u4ee5\u65b9\u4fbf\u5730\u7528\u4e8e\u6279\u91cf\u5904\u7406\u591a\u4e2a\u56fe\u50cf\uff0c\u4f8b\u5982\u6279\u91cf\u8c03\u6574\u5927\u5c0f\u6216\u8f6c\u6362\u683c\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>input_folder = &#39;input_images&#39;<\/p>\n<p>output_folder = &#39;output_images&#39;<\/p>\n<p>for filename in os.listdir(input_folder):<\/p>\n<p>    if filename.endswith(&#39;.jpg&#39;):<\/p>\n<p>        img = Image.open(os.path.join(input_folder, filename))<\/p>\n<p>        img_resized = img.resize((200, 200))<\/p>\n<p>        img_resized.save(os.path.join(output_folder, filename))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u9ad8\u6548\u5730\u5904\u7406\u5927\u91cf\u56fe\u50cf\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u5185\u5bb9\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u5b89\u88c5Python PIL\uff08\u5373Pillow\uff09\uff0c\u5e76\u5c55\u793a\u4e86\u5176\u57fa\u672c\u548c\u9ad8\u7ea7\u529f\u80fd\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u56fe\u50cf\u52a0\u8f7d\u548c\u4fdd\u5b58\uff0c\u8fd8\u662f\u590d\u6742\u7684\u56fe\u50cf\u5904\u7406\u548c\u6279\u91cf\u64cd\u4f5c\uff0cPillow\u90fd\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\u6765\u6ee1\u8db3\u4f60\u7684\u9700\u6c42\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528Pillow\u8fdb\u884c\u56fe\u50cf\u5904\u7406\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u68c0\u67e5\u6211\u7684\u7cfb\u7edf\u662f\u5426\u5df2\u5b89\u88c5Python\u548cPIL\uff1f<\/strong><br \/>\u5728\u5b89\u88c5Python PIL\u4e4b\u524d\uff0c\u786e\u8ba4\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5Python\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u67e5\u770bPython\u7684\u7248\u672c\u3002\u5982\u679cPython\u5df2\u5b89\u88c5\uff0c\u63a5\u7740\u68c0\u67e5PIL\u662f\u5426\u5b58\u5728\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u8f93\u5165<code>pip show pillow<\/code>\uff0c\u56e0\u4e3aPIL\u7684\u73b0\u4ee3\u7248\u672c\u662fPillow\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u60a8\u4f1a\u770b\u5230\u76f8\u5173\u63d0\u793a\u3002<\/p>\n<p><strong>PIL\u548cPillow\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>PIL\uff08Python Imaging Library\uff09\u662f\u4e00\u4e2a\u8001\u65e7\u7684\u5e93\uff0c\u7528\u4e8e\u56fe\u50cf\u5904\u7406\uff0c\u800cPillow\u662fPIL\u7684\u4e00\u4e2a\u5206\u652f\uff0c\u7ecf\u8fc7\u7ef4\u62a4\u548c\u66f4\u65b0\uff0c\u63d0\u4f9b\u4e86\u66f4\u591a\u529f\u80fd\u548c\u652f\u6301\u3002Pillow\u4e0d\u4ec5\u53ef\u4ee5\u517c\u5bb9PIL\u7684\u529f\u80fd\uff0c\u8fd8\u6dfb\u52a0\u4e86\u65b0\u7279\u6027\u548c\u4fee\u590d\u4e86\u65e7\u7248\u672c\u4e2d\u7684\u4e00\u4e9b\u9519\u8bef\u3002\u56e0\u6b64\uff0c\u5f3a\u70c8\u63a8\u8350\u5b89\u88c5Pillow\u4f5c\u4e3a\u56fe\u50cf\u5904\u7406\u5e93\u3002<\/p>\n<p><strong>\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5Pillow\u6709\u4ec0\u4e48\u597d\u5904\uff1f<\/strong><br \/>\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5Pillow\u53ef\u4ee5\u907f\u514d\u4e0e\u7cfb\u7edf\u4e2d\u7684\u5176\u4ed6Python\u5305\u4ea7\u751f\u51b2\u7a81\u3002\u901a\u8fc7\u4f7f\u7528\u865a\u62df\u73af\u5883\uff0c\u60a8\u53ef\u4ee5\u4e3a\u6bcf\u4e2a\u9879\u76ee\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684Python\u73af\u5883\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u9879\u76ee\u4f7f\u7528\u7684\u5e93\u7248\u672c\u662f\u72ec\u7acb\u7684\uff0c\u4fbf\u4e8e\u7ba1\u7406\u548c\u7ef4\u62a4\u3002\u540c\u65f6\uff0c\u8fd9\u79cd\u505a\u6cd5\u4e5f\u63d0\u9ad8\u4e86\u9879\u76ee\u7684\u53ef\u79fb\u690d\u6027\uff0c\u8ba9\u4e0d\u540c\u7684\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u5404\u81ea\u73af\u5883\u4e2d\u8fd0\u884c\u76f8\u540c\u7684\u4ee3\u7801\u800c\u4e0d\u4ea7\u751f\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b89\u88c5Python PIL\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u4f7f\u7528pip\u5b89\u88c5Pillow\u3001\u786e\u4fddPython\u73af\u5883\u6b63\u786e\u914d\u7f6e\u3001\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f [&hellip;]","protected":false},"author":3,"featured_media":938871,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/938869"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=938869"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/938869\/revisions"}],"predecessor-version":[{"id":938872,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/938869\/revisions\/938872"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/938871"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=938869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=938869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=938869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}