{"id":290220,"date":"2024-03-02T21:23:15","date_gmt":"2024-03-02T13:23:15","guid":{"rendered":"https:\/\/lrxjmw.cn\/txcllqlmlsdj.html"},"modified":"2024-03-02T21:23:15","modified_gmt":"2024-03-02T13:23:15","slug":"txcllqlmlsdj","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/txcllqlmlsdj.html","title":{"rendered":"\u56fe\u50cf\u5904\u7406\u5229\u5668\uff01Linux Convert\u547d\u4ee4\u6df1\u5ea6\u89e3\u8bfb"},"content":{"rendered":"
\u672c\u7ae0\u9488\u5bf9Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\u56fe\u50cf\u5904\u7406\u7684\u6838\u5fc3\u5de5\u5177\u2014\u2014Convert\u547d\u4ee4<\/a>\u8fdb\u884c\u6df1\u5ea6\u89e3\u8bfb\u3002\u901a\u8fc7\u5bf9\u65b9\u4fbf\u5b9e\u7528\u7684\u7279\u6027\uff0c\u5982\u56fe\u7247\u8f6c\u6362\uff0c\u5c3a\u5bf8\u8c03\u6574\u4ee5\u53ca\u6587\u4ef6\u683c\u5f0f\u4e92\u6362\u7b49\u529f\u80fd\u8fdb\u884c\u8be6\u7ec6\u63a2\u8ba8\uff0c\u5e2e\u52a9\u60a8\u4e86\u89e3\u5982\u4f55\u9ad8\u6548\u4f7f\u7528\u6b64\u5de5\u5177\u3002<\/p>\n 1.\u5b89\u88c5convert\u547d\u4ee4<\/b><\/p>\n \u9996\u5148\u9700\u8981\u786e\u4fdd\u7cfb\u7edf\u5df2\u7ecf\u6574\u5408\u4e86\u5305\u542bconvert\u6307\u4ee4\u7684ImageMagick\u7ec4\u4ef6\uff0c\u5982\u679c\u5c1a\u672a\u5b8c\u6210\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n \u8bf7\u4e8e\u7ec8\u7aef\u952e\u5165\u6307\u4ee4\u201csudo apt-get install imagemagick\u201d\uff0c\u4ee5\u6b64\u5b8c\u6210ImageMagick\u7684\u5b89\u88c5\u3002<\/p>\n 2.\u56fe\u7247\u683c\u5f0f\u8f6c\u6362<\/b><\/p>\n \u501f\u52a9Convert\u5de5\u5177\uff0c\u6211\u4eec\u53ef\u4ee5\u9ad8\u6548\u5730\u6267\u884c\u56fe\u50cf\u683c\u5f0f\u7684\u8f6c\u6362\uff0c\u5982\u7b80\u5355\u9ad8\u6548\u5730\u4eceJPG\u5230PNG\u7684\u8f6c\u5316\u3002<\/p>\n convert input.jpg output.png<\/p>\n \u81f3\u6b64\uff0c\u6211\u4eec\u5df2\u6210\u529f\u5c06\u8f93\u5165\u6587\u4ef6input.jpg\u7684\u8f93\u51fa\u683c\u5f0f\u8f6c\u4e3aoutput.png\u3002<\/p>\n 3.\u56fe\u7247\u5c3a\u5bf8\u8c03\u6574<\/b><\/p>\n \u5728\u7279\u6b8a\u60c5\u51b5\u4e0blinux\u64cd\u4f5c\u7cfb\u7edf\u754c\u9762\u624b\u673alinux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5bf9\u56fe\u50cf\u8fdb\u884c\u7279\u5b9a\u5c3a\u5bf8\u7684\u8c03\u6574\u5341\u5206\u5fc5\u8981\u3002\u501f\u52a9\u4e8econvert\u547d\u4ee4\uff0c\u8fc7\u7a0b\u5c06\u66f4\u4e3a\u4fbf\u6377\u3002\u6bd4\u5982\uff0c\u53ef\u4ee5\u5c06\u67d0\u5e45\u56fe\u50cf\u7684\u5bbd\u5ea6\u8bbe\u5b9a\u4e3a800\u50cf\u7d20\uff0c\u800c\u5176\u9ad8\u5ea6\u5219\u4f1a\u81ea\u9002\u5e94\u53d8\u5316\u3002<\/p>\n \u5c06\u539f\u59cb\u6587\u4ef6input.jpg\u7684\u5bbd\u9ad8\u5206\u522b\u8c03\u6574\u81f3800px\u540e\uff0c\u51fa\u793a\u6587\u4ef6output.jpg\u3002<\/p>\n \u8c03\u6574\u8f93\u5165-resize\u53c2\u6570\u81f3\u6240\u8bbe\u5927\u5c0f\uff08\u5982800\u50cf\u7d20\uff09\uff0c\u5373\u53ef\u4ea7\u751f\u8f93\u51fa\u6587\u4ef6output.jpg\u3002<\/p>\n 4.\u56fe\u7247\u65cb\u8f6c\u548c\u7ffb\u8f6c<\/b><\/p>\n <\/p>\n \u901a\u8fc7\u8fd0\u7528convert\u6307\u4ee4\u529f\u80fdlinux convert \u547d\u4ee4<\/strong>\uff0c\u53ef\u4ee5\u5728\u8bf8\u591a\u65b9\u9762\u7075\u6d3b\u5730\u5b9e\u73b0\u56fe\u50cf\u7684\u65cb\u8f6c\u548c\u7ffb\u8f6c\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u5bf9\u539f\u56fe\u50cf\u4f5c\u4e00\u6b21\u4ee5\u987a\u65f6\u949f\u4e5d\u5341\u5ea6\u4e3a\u89d2\u5ea6\u7684\u65cb\u8f6c\u5904\u7406\uff1a<\/p>\n \u5c06\u8f93\u5165\u7684JPG\u56fe\u50cf\u65cb\u8f6c90\u5ea6\u540e\u751f\u6210\u8f93\u51fa\u6587\u4ef6\u3002<\/p>\n \u81f3\u6b64\uff0c\u6211\u4eec\u5df2\u7ecf\u5706\u6ee1\u5b8c\u6210\u4e86\u81eainput.jpg\u5f00\u59cb\uff0c\u6cbf\u987a\u65f6\u9488\u65b9\u5411\u65cb\u8f6c90\u5ea6\u4ee5\u4fdd\u5b58\u4e3aoutput.jpg\u7684\u4efb\u52a1\u3002<\/p>\n 5.\u6279\u91cf\u5904\u7406\u56fe\u7247<\/b><\/p>\n \u6b32\u5bf9\u591a\u5f20\u56fe\u7247\u5b9e\u884c\u901a\u7528\u64cd\u4f5c\u65f6\uff0c\u8f6c\u6362\u6307\u4ee4\u7684\u4f7f\u7528\u663e\u5f97\u5c24\u4e3a\u91cd\u8981\u3002\u82e5\u8981\u5c06\u6587\u4ef6\u5939\u4e2d\u7684\u6240\u6709jpg\u56fe\u7247\u6279\u91cf\u8f6c\u5316\u6210png\u683c\u5f0f\u7684\u56fe\u50cf\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u65b9\u5f0f\uff1a<\/p>\n mogrify -format png *.jpg<\/p>\n \u901a\u8fc7\u6267\u884c mogrify \u6307\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u9ad8\u6548\u5730\u5c06\u6240\u6709 jpg \u56fe\u7247\u8f6c\u5316\u4e3a png \u683c\u5f0f\u3002<\/p>\n 6.\u6dfb\u52a0\u6c34\u5370<\/b><\/p>\n \u5f53\u6709\u5fc5\u8981\u65f6\uff0c\u4e3a\u4e86\u786e\u4fdd\u7248\u6743\u4fdd\u62a4\u548c\u589e\u5f3a\u53ef\u8bc6\u522b\u6027\uff0c\u5efa\u8bae\u5bf9\u56fe\u50cf\u9644\u52a0\u5f3a\u5236\u6027\u6c34\u5370\u3002\u6b64\u65f6\uff0c\u5f3a\u529b\u7684convert\u6307\u4ee4\u80fd\u591f\u6ee1\u8db3\u8be5\u9700\u6c42\uff0c\u5176\u63d0\u4f9b\u4e86\u56fe\u6587\u805a\u5408\u6c34\u5370\u7684\u6dfb\u52a0\u529f\u80fd\u3002\u8b6c\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u6307\u5b9a\u6587\u5b57\u4f5c\u4e3a\u6c34\u5370\u8d34\u9644\u5728\u4efb\u610f\u56fe\u50cf\u4e2d\uff1a<\/p>\n \u5c06\u8f93\u5165\u7684JPG\u56fe\u7ecf\u8fc7\u5c3a\u5bf8\u7f29\u51cf\u4e3a20\u50cf\u7d20\u5e76\u586b\u5145\u767d\u8272\u5904\u7406\u540e\uff0c\u6dfb\u52a0\u6587\u5b57\u6c34\u5370\u6307\u4ee4\"watermark\"\uff0c\u5176\u4f4d\u7f6e\u5b9a\u5728\uff0810, 10\uff09\u5904\uff0c\u6700\u7ec8\u751f\u6210\u5bf9\u5e94\u7684JPEG\u56fe\u7247\u4f5c\u4e3a\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n \u53ea\u9700\u914d\u7f6e-pointsize\u3001-fill\u53ca-draw\u7b49\u591a\u79cd\u9009\u9879\uff0c\u4fbf\u53ef\u5b8c\u6210input.jpg\u56fe\u7a3f\u7684\u5904\u7406\u5de5\u4f5c\u3002\u6700\u7ec8\u7ed3\u679c\u5c06\u662f\u5e26\u6709\u767d\u8272\u6587\u672c\u7684\u6c34\u5370\u56fe\u7247\u5e76\u4fdd\u5b58\u4e8eoutput.jpg\u6587\u4ef6\u5185\u3002<\/p>\n 7.\u56fe\u7247\u6a21\u7cca\u5904\u7406<\/b><\/p>\n <\/p>\n \u5728\u90e8\u5206\u573a\u5408\u4e2d\uff0c\u7167\u7247\u4e3a\u4e86\u8fbe\u5230\u67d0\u79cd\u7279\u6b8a\u7684\u8868\u73b0\u6548\u679c\uff0c\u53ef\u80fd\u9700\u8981\u91c7\u53d6\u6a21\u7cca\u5904\u7406\u6280\u672f\u3002\u4f7f\u7528convert\u547d\u4ee4\u80fd\u591f\u4fbf\u6377\u5730\u5b9e\u73b0\u6b64\u76ee\u7684\u3002\u6bd4\u5982linux convert \u547d\u4ee4<\/strong>\uff0c\u5f53\u6211\u4eec\u5e0c\u671b\u7ed9\u67d0\u4e2a\u56fe\u7247\u5b9e\u65bd\u6a21\u7cca\u5904\u7406\u65f6\uff1a<\/p>\n \u8f93\u5165\"input.jpg\"\u540e\uff0c\u7acb\u5373\u8fdb\u884c\u62c9\u4f38\u53ca\u6a21\u7cca\u5904\u7406\uff0c\u5c06\u6a21\u7cca\u7cfb\u6570\u8bbe\u5b9a\u4e3a\"0x8\",\u751f\u6210\u7684\u7ed3\u679c\u4fdd\u5b58\u81f3\u540d\u4e3a\"output.jpg\"\u7684\u65b0\u6587\u4ef6\u5939\u5185\u3002<\/p>\n \u901a\u8fc7\u4f7f\u7528-blur\u53c2\u6570\u5e76\u8bbe\u5b9a\u9002\u5b9c\u7684\u6a21\u7cca\u5ea6\uff0c\u4fbf\u80fd\u5f97\u5230\u7ecf\u6a21\u7cca\u5904\u7406\u540e\u7684\u8f93\u51fa\u56fe\u50cfoutput.jpg\u3002<\/p>\n 8.\u56fe\u7247\u5408\u5e76<\/b><\/p>\n \u5728\u7279\u5b9a\u7684\u6848\u4f8b\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u628a\u591a\u5f20\u56fe\u7247\u5408\u6210\u4e00\u4e2a\uff0c\u501f\u52a9\u4e8e\u201cconvert\u201d\u547d\u4ee4\u8fd9\u4e00\u8fc7\u7a0b\u4f1a\u53d8\u5f97\u8f7b\u677e\u8bb8\u591a\u3002\u4f8b\u5982\uff0c\u82e5\u8981\u5c06\u4e24\u5f20\u56fe\u5f62\u8fdb\u884c\u5782\u76f4\u62fc\u63a5\uff1a<\/p>\n \u6211\u4eec\u7684\u4efb\u52a1\u662f\u5bf9\u8f93\u5165\u56fe\u50cfinput1.jpg\u53cainput2.jpg\u8fdb\u884c\u6df1\u5ea6\u5904\u7406\uff0c\u5e76\u4ea7\u751f\u7cbe\u7f8e\u7684output.jpg\u56fe\u50cf\u4f5c\u4e3a\u6700\u7ec8\u6210\u679c\u3002<\/p>\n \u901a\u8fc7\u5229\u7528\"+append\"\u53c2\u6570\u548c\u591a\u4e2a\u8f93\u5165\u6587\u4ef6\u540d\u5373\u53ef\u5b9e\u73b0input1.jpg\u4e0einput2.jpg\u5782\u76f4\u5408\u5e76\u5e76\u751f\u6210\u8f93\u51fa\u6587\u4ef6output.jpg\u3002<\/p>\n 9.\u6279\u91cf\u91cd\u547d\u540d\u56fe\u7247<\/b><\/p>\n \u5bf9\u4e8e\u5927\u6279\u91cf\u56fe\u7247\u65e8\u5728\u8fdb\u884c\u4fbf\u5229\u7ba1\u7406\u66f4\u540d\u7684\u9700\u6c42\uff0c\u5229\u7528\"convert\"\u547d\u4ee4\u4fbf\u80fd\u8f7b\u677e\u5e94\u5bf9\u3002\u4f8b\u5982\uff0c\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5c06\u7279\u5b9a\u6587\u4ef6\u5939\u4e2d\u7684\u5168\u90e8jpg\u683c\u5f0f\u56fe\u7247\u6309\u5e8f\u66f4\u6539\u4e3aimage1.jpg\u5230imageN.jpg\u7684\u547d\u540d(\u5176\u4e2d\uff0cN\u4e3a\u56fe\u7247\u603b\u6570)\uff1a<\/p>\n \u5904\u7406\u6240\u6709\u4ee5.jpg\u7ed3\u5c3e\u7684\u6587\u4ef6\u3002\u9996\u5148\u8f6c\u6362\u5176\u683c\u5f0f\uff0c\u518d\u6839\u636e\u7279\u5b9a\u8981\u6c42\u8fdb\u884c\u5c3a\u5bf8\u8c03\u8282\u3002\u5177\u4f53\u64cd\u4f5c\u662f\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u6587\u4ef6\uff0c\u8bbe\u5b9a\u5927\u5c0f\u4e3a800X\uff0c\u5e76\u628a\u6700\u7ec8\u7ed3\u679c\u5b58\u5165\u540d\u4e3aimage$(i++).jpg\u7684\u65b0\u6587\u4ef6\u4e2d\u3002<\/p>\n \u5229\u7528for\u5faa\u73af\u53ca-resize\u53c2\u6570\uff0c\u5feb\u901f\u5b8c\u6210JPG\u56fe\u7247\u7684\u6279\u91cf\u547d\u540d\u3002<\/p>\n \u672c\u6587\u9610\u8ff0\u4e86Linux convert\u547d\u4ee4\u7684\u663e\u8457\u4f18\u52bf\u53ca\u7279\u6027\uff0c\u65e8\u5728\u589e\u8fdb\u8bfb\u8005\u5bf9\u5b83\u7684\u6df1\u523b\u8ba4\u77e5\u3002\u8be5\u6307\u4ee4\u517c\u5177\u5f3a\u5927\u6548\u7528\u548c\u6613\u4e8e\u64cd\u4f5c\u7684\u53cc\u91cd\u7279\u70b9\uff0c\u5145\u5206\u6ee1\u8db3\u4e86\u591a\u79cd\u56fe\u50cf\u5904\u7406\u9700\u6c42\u3002\u671f\u5f85\u8fd9\u7bc7\u6587\u7ae0\u6709\u52a9\u4e8e\u8bf8\u4f4d\u5728\u5b9e\u9645\u5de5\u4f5c\u4e0e\u751f\u6d3b\u4e2d\u53d1\u6325\u79ef\u6781\u4f5c\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u672c\u7ae0\u9488\u5bf9Linux\u7cfb\u7edf\u4e2d\u56fe\u50cf\u5904\u7406\u7684\u6838\u5fc3\u5de5\u5177\u2014\u2014Convert\u547d\u4ee4\u8fdb\u884c\u6df1\u5ea6\u89e3\u8bfb\u3002\u501f\u52a9Convert\u5de5\u5177\uff0c\u6211\u4eec\u53ef\u4ee5\u9ad8\u6548\u5730\u6267\u884c\u56fe\u50cf\u683c\u5f0f\u7684\u8f6c\u6362\uff0c\u5982\u7b80\u5355\u9ad8\u6548\u5730\u4eceJPG\u5230PNG\u7684\u8f6c\u5316\u3002\u501f\u52a9\u4e8econvert\u547d\u4ee4\uff0c\u8fc7\u7a0b\u5c06\u66f4\u4e3a\u4fbf\u6377\u3002jpg\u8fdb\u884c\u6df1\u5ea6\u5904\u7406\uff0c\u5e76\u4ea7\u751f\u7cbe\u7f8e\u7684output.<\/p>\n","protected":false},"author":1,"featured_media":290221,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-290220","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/290220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=290220"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/290220\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/290221"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=290220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=290220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=290220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}