\u4e86\u89e3\u5982\u4f55\u5c06\u6570\u5341\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u6587\u4ef6\u7c7b\u578b(\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e PNG \u548c JPG)\u5206\u522b\u8f6c\u6362\u4e3a GIF \u548c WebP \u683c\u5f0f\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u4e86\u89e3\u5982\u4f55\u5c06\u6570\u5341\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u6587\u4ef6\u7c7b\u578b(\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e PNG \u548c JPG)\u5206\u522b\u8f6c\u6362\u4e3a GIF \u548c WebP \u683c\u5f0f\u3002<\/p>\n
<\/p>\n
\u5982\u679c\u6211\u4eec\u51c6\u5907\u5728\u7ebf\u4e3a\u7279\u5b9a\u76ee\u7684\u91cd\u65b0\u683c\u5f0f\u5316\u56fe\u50cf\uff0c\u6211\u4eec\u9009\u62e9\u7684\u65b0\u683c\u5f0f\u9700\u8981\u51c6\u786e\u53cd\u6620\u6211\u4eec\u8bbe\u60f3\u7684\u7528\u4f8b\u3002\u5426\u5219\uff0c\u6211\u4eec\u4f1a\u5728\u4e0d\u7ecf\u610f\u95f4\u627c\u6740\u6211\u4eec\u81ea\u5df1\u7684\u6548\u7387\uff0c\u6700\u91cd\u8981\u7684\u662f\uff0c\u5192\u7740\u964d\u4f4e\u7f51\u9875\u52a0\u8f7d\u901f\u5ea6\u7684\u98ce\u9669\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u6587\u4ef6\u683c\u5f0f\u9009\u62e9\u4e5f\u662f\u5982\u6b64\uff1a\u6211\u4eec\u4e0d\u4f1a\u4f7f\u7528 Microsoft Word \u521b\u5efa\u7535\u5b50\u8868\u683c\uff0c\u4e5f\u4e0d\u4f1a\u4f7f\u7528 Excel \u64b0\u5199\u8bba\u6587(\u5c3d\u7ba1\u4ece\u6280\u672f\u4e0a\u8bb2\u4e24\u8005\u90fd\u53ef\u4ee5)\u3002<\/p>\n
\u9009\u62e9\u4f7f\u7528\u54ea\u79cd\u56fe\u50cf\u683c\u5f0f\u9700\u8981\u6211\u4eec\u8003\u8651\u6211\u4eec\u671f\u671b\u8be5\u6587\u4ef6\u670d\u52a1\u7684\u786e\u5207\u76ee\u7684\u3002\u867d\u7136\u6211\u4eec\u5728\u7f51\u4e0a\u9047\u5230\u7684\u6700\u666e\u904d\u7684\u683c\u5f0f\u2014\u2014\u5373JPG \u548c PNG\u2014\u2014\u4e3a\u5b83\u4eec\u5404\u81ea\u7684\u7528\u4f8b\u63d0\u4f9b\u4e86\u4f17\u6240\u5468\u77e5\u7684\u597d\u5904\uff0c\u4f46\u5b83\u4eec\u5728\u67d0\u4e9b\u5173\u952e\u9886\u57df\u4e5f\u5b58\u5728\u4e0d\u8db3\u3002\u4f8b\u5982\uff0c\u867d\u7136 JPG \u683c\u5f0f\u7531\u4e8e\u5176\u9ad8\u5ea6\u538b\u7f29(\u5141\u8bb8\u7f51\u9875\u8fd0\u884c\u5f97\u66f4\u5feb)\u800c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u7f51\u7ad9\u9875\u9762\uff0c\u4f46\u8fd9\u79cd\u538b\u7f29\u7a0b\u5ea6\u4f1a\u727a\u7272\u5927\u91cf\u7684\u56fe\u50cf\u8d28\u91cf\uff0c\u6211\u4eec\u53ef\u80fd\u5e76\u4e0d\u603b\u662f\u613f\u610f\u5931\u53bb. \u867d\u7136 PNG \u662f\u4e00\u79cd\u5177\u6709\u5185\u7f6e\u900f\u660e\u5ea6\u529f\u80fd\u7684\u65e0\u635f\u683c\u5f0f\u2014\u2014\u975e\u5e38\u9002\u5408\u5728\u7eaf\u8272\u80cc\u666f\u4e0a\u663e\u793a\u56fe\u5f62\u3001\u5fbd\u6807\u548c\u63d2\u56fe\u7b49\u5185\u5bb9\u2014\u2014\u4f46\u5b83\u660e\u663e\u7f3a\u4e4f\u9002\u5e94\u5e38\u89c1\u5728\u7ebf\u7528\u4f8b(\u5982\u56fe\u50cf\u52a8\u753b)\u7684\u80fd\u529b\u5f53\u9700\u8981\u65f6\u3002<\/p>\n
\u5bf9\u4e8e\u6211\u4eec\u66f4\u4e13\u4e1a\u7684\u683c\u5f0f\u8981\u6c42\uff0c\u6211\u4eec\u53ef\u4ee5\u6c42\u52a9\u4e8e\u5176\u4ed6\u5e38\u89c1\u7684\u56fe\u50cf\u683c\u5f0f\u2014\u2014\u65e0\u8bba\u662f\u65e7\u7684\u8fd8\u662f\u65b0\u7684\u2014\u2014\u6765\u5b9e\u73b0\u6211\u4eec\u7684\u76ee\u6807\u3002GIF \u683c\u5f0f\u5df2\u7ecf\u6709 30 \u591a\u5e74\u7684\u5386\u53f2\u4e86\u2014\u2014\u5b83\u6bd4\u6700\u521d\u7684\u4e07\u7ef4\u7f51\u8fd8\u8981\u65e9\u2014\u2014\u4f46\u5b83\u72ec\u7279\u5730\u5141\u8bb8\u521b\u5efa\u57fa\u672c\u7684\u9010\u5e27\u52a8\u753b\uff0c\u5e76\u4e14\u5b83\u8fd8\u5141\u8bb8\u7f51\u9875\u4ee5\u66f4\u9ad8\u7684\u901f\u5ea6\u52a0\u8f7d\u8fd9\u4e9b\u52a8\u753b\u901f\u5ea6\u6bd4\u540c\u7c7b\u65b9\u6cd5(\u4f8b\u5982\uff0c\u4f20\u7edf\u7684\u89c6\u9891\u63d2\u4ef6)\u53ef\u4ee5\u3002 WebP \u683c\u5f0f\u2014\u2014\u7531\u8c37\u6b4c\u5728 10 \u591a\u5e74\u524d\u521b\u5efa\u2014\u2014\u8db3\u591f\u65b0\uff0c\u5b83\u4ecd\u7136\u7f3a\u4e4f\u4e0e\u8bb8\u591a\u7f51\u7ad9\u7684\u4e0a\u4f20\u517c\u5bb9\u6027\uff0c\u4f46\u5b83\u7684\u4f18\u52bf\u662f\u4e0d\u53ef\u5426\u8ba4\u7684\uff1a\u5b83\u4e0d\u4ec5\u6bd4 JPG \u63d0\u4f9b\u8d85\u8fc7 20% \u7684\u538b\u7f29\u7387\uff0c\u800c\u4e14PNG\uff0c\u4f46\u5b83\u5141\u8bb8\u6709\u635f\u548c\u65e0\u635f\u538b\u7f29\uff0c\u786e\u4fdd\u6211\u4eec\u5e76\u4e0d\u603b\u662f\u9700\u8981\u5728\u56fe\u50cf\u8d28\u91cf\u548c\u7f51\u9875\u52a0\u8f7d\u901f\u5ea6\u4e4b\u95f4\u8fdb\u884c\u9009\u62e9\u3002<\/p>\n
\u9274\u4e8e\u8fd9\u4e9b\u5e38\u89c1\u56fe\u50cf\u683c\u5f0f\u7684\u4e0d\u540c\u7528\u4f8b\uff0c\u683c\u5f0f\u4e4b\u95f4\u7684\u8f6c\u6362\u662f\u8bb8\u591a\u5185\u5bb9\u4e13\u4e1a\u4eba\u5458\u7684\u65e5\u5e38\u9700\u6c42\uff0c\u8fd9\u79cd\u9700\u6c42\u9f13\u52b1\u91c7\u8d2d\u80fd\u591f\u5927\u89c4\u6a21\u9ad8\u6548\u6267\u884c\u8f6c\u6362\u7684\u670d\u52a1\u3002\u4e0b\u9762\uff0c\u6211\u5c06\u6f14\u793a\u5982\u4f55\u5229\u7528\u4e24\u79cd API \u89e3\u51b3\u65b9\u6848\uff0c\u5e2e\u52a9\u5c06\u6570\u5341\u79cd\u5e38\u89c1\u56fe\u50cf\u6587\u4ef6\u7c7b\u578b(\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e PNG \u548c JPG)\u5206\u522b\u8f6c\u6362\u4e3a GIF \u548c WebP \u683c\u5f0f\u3002<\/p>\n
\u793a\u8303
\n\u4e0b\u9762\uff0c\u6211\u63d0\u4f9b\u4e86 Java \u4ee3\u7801\u793a\u4f8b\u6765\u5e2e\u52a9\u60a8\u6784\u5efa\u5bf9\u4e0a\u8ff0\u4e24\u79cd\u56fe\u50cf\u683c\u5f0f\u8f6c\u6362 API \u89e3\u51b3\u65b9\u6848\u7684 API \u8c03\u7528\u3002\u6b64\u5916\uff0c\u6211\u8fd8\u63d0\u4f9b\u4e86\u5e2e\u52a9\u60a8\u4f7f\u7528 Maven \u6216 Gradle \u5b89\u88c5\u56fe\u50cf\u8f6c\u6362 API \u5ba2\u6237\u7aef\u7684\u8bf4\u660e(\u53d6\u51b3\u4e8e\u60a8\u7684\u504f\u597d)\u3002<\/p>\n
\u8981\u4f7f\u7528 Maven \u5f00\u59cb API \u5ba2\u6237\u7aef\u5b89\u88c5\u9636\u6bb5\uff0c\u6211\u4eec\u7684\u7b2c\u4e00\u6b65\u662f\u5728 pom.xml \u4e2d\u6dfb\u52a0\u5bf9\u5b58\u50a8\u5e93\u7684\u5f15\u7528\uff1a<\/p>\n
\n\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0\u4ee5\u4e0b\u4f9d\u8d56\u5f15\u7528\uff0c\u8fd9\u5c06\u5141\u8bb8 JitPack \u52a8\u6001\u7f16\u8bd1\u5e93\uff1a<\/p>\n
<\/p>\n
\u8981\u4f7f\u7528Gradle\u5b89\u88c5\uff0c\u6211\u4eec\u9700\u8981\u9996\u5148\u5c06\u4ee5\u4e0b\u4ee3\u7801\u6bb5\u6dfb\u52a0\u5230\u6839 build.gradle(\u5728\u5b58\u50a8\u5e93\u7684\u672b\u5c3e)\uff1a<\/p>\n
\r\nallprojects {\r\nrepositories {\r\n...\r\nmaven { url 'https:\/\/jitpack.io' }\r\n}\r\n}\r\n<\/pre>\n\u7136\u540e\uff0c\u603b\u7ed3\u4e00\u4e0b\uff0c\u6211\u4eec\u9700\u8981\u5728 build.gradle \u4e2d\u6dfb\u52a0\u4f9d\u8d56\u9879\uff1a<\/p>\n
\r\ndependencies {\r\nimplementation '\r\ncom.github.Cloudmersive:Cloudmersive.APIClient.Java:v4.25'\r\n}\r\n<\/pre>\n\u5b89\u88c5\u6b65\u9aa4\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u73b0\u5728\u53ef\u4ee5\u4e3a\u6bcf\u4e2a API \u89e3\u51b3\u65b9\u6848\u6dfb\u52a0\u5bfc\u5165\uff0c\u7136\u540e\u76f4\u63a5\u8c03\u7528\u5b83\u4eec\u5404\u81ea\u7684\u51fd\u6570\u3002\u5728\u6211\u4eec\u8fd9\u6837\u505a\u4e4b\u524d\uff0c\u6211\u60f3\u5feb\u901f\u6307\u51fa\uff0c\u5728\u4e0b\u9762\u63d0\u4f9b\u7684\u6bcf\u4e2a\u51fd\u6570\u4e2d\uff0c\u90fd\u6709\u4e00\u4e2a\u8eab\u4efd\u9a8c\u8bc1\u5b57\u6bb5(\u5728\u5bfc\u5165\u4e0b\u65b9\uff0c\u7531\u4ee3\u7801\u6ce8\u91ca\u6307\u793a)\u6355\u83b7 API \u5bc6\u94a5\u8f93\u5165\u3002\u5728 Cloudmersive \u7f51\u7ad9\u4e0a\u6ce8\u518c\u514d\u8d39\u5c42 API \u5bc6\u94a5\u540e\uff0c\u60a8\u53ea\u9700\u5c06 API \u5bc6\u94a5\u5b57\u7b26\u4e32\u590d\u5236\u5e76\u7c98\u8d34\u5230\u76f8\u5e94\u5b57\u6bb5\u4e2d\uff0c\u5373\u53ef\u5b8c\u6210API \u5bc6\u94a5\u8eab\u4efd\u9a8c\u8bc1\u6b65\u9aa4\u3002<\/p>\n
\u8981\u5c06\u56fe\u50cf\u8f6c\u6362\u4e3a GIF \u683c\u5f0f\uff0c\u6211\u4eec\u5c06\u8c03\u7528\u4ee5\u4e0b\u51fd\u6570\u3002\u6211\u4eec\u9700\u8981\u505a\u7684\u5c31\u662f\u5728imageFile\u5b57\u6bb5\u4e2d\u5305\u542b\u6211\u4eec\u7684\u56fe\u50cf\u6587\u4ef6\u8def\u5f84\uff0c\u7136\u540e\u6211\u4eec\u5c31\u5b8c\u6210\u4e86\uff1a<\/p>\n
\r\n\/\/ Import classes:\r\n\/\/import\r\ncom.cloudmersive.client.invoker.ApiClient;\r\n\/\/import\r\ncom.cloudmersive.client.invoker.ApiException;\r\n\/\/import\r\ncom.cloudmersive.client.invoker.Configuration;\r\n\/\/import\r\ncom.cloudmersive.client.invoker.auth.*;\r\n\/\/import\r\ncom.cloudmersive.client.ConvertApi;\r\nApiClient defaultClient =\r\nConfiguration.getDefaultApiClient();\r\n\/\/ Configure API key authorization: Apikey\r\nApiKeyAuth Apikey = (ApiKeyAuth)\r\ndefaultClient.getAuthentication(\"Apikey\");\r\nApikey.setApiKey(\"YOUR API KEY\");\r\n\/\/ Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\r\n\/\/Apikey.setApiKeyPrefix(\"Token\");\r\nConvertApi apiInstance = new ConvertApi();\r\nFile imageFile = new File(\"\/path\/to\/inputfile\"); \/\/ File | Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.\r\ntry {\r\nbyte[] result = apiInstance.convertToGif(imageFile);\r\nSystem.out.println(result);\r\n} catch (ApiException e) {\r\nSystem.err.println(\"Exception when calling ConvertApi#convertToGif\");\r\ne.printStackTrace();\r\n}\r\n<\/pre>\n\u8981\u5c06\u56fe\u50cf\u8f6c\u6362\u4e3a WebP \u683c\u5f0f\uff0c\u6211\u4eec\u5c06\u8c03\u7528\u4ee5\u4e0b\u51fd\u6570\u3002\u5c31\u50cf\u4ee5\u524d\u4e00\u6837\uff0c\u53ea\u9700\u5728imageFile\u5b57\u6bb5\u4e2d\u5305\u542b\u60a8\u7684\u6587\u4ef6\u8def\u5f84\uff0c\u60a8\u5c31\u5b8c\u6210\u4e86\uff1a<\/p>\n
\r\n\/\/ Import classes:\r\n\/\/import\r\ncom.cloudmersive.client.invoker.ApiClient;\r\n\/\/import\r\ncom.cloudmersive.client.invoker.ApiException;\r\n\/\/import\r\ncom.cloudmersive.client.invoker.Configuration;\r\n\/\/import\r\ncom.cloudmersive.client.invoker.auth.*;\r\n\/\/import\r\ncom.cloudmersive.client.ConvertApi;\r\nApiClient defaultClient =\r\nConfiguration.getDefaultApiClient();\r\n\/\/ Configure API key authorization: Apikey\r\nApiKeyAuth Apikey = (ApiKeyAuth)\r\ndefaultClient.getAuthentication(\"Apikey\");\r\nApikey.setApiKey(\"YOUR API KEY\");\r\n\/\/ Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\r\n\/\/Apikey.setApiKeyPrefix(\"Token\");\r\nConvertApi apiInstance = new ConvertApi();\r\nFile imageFile = new File(\"\/path\/to\/inputfile\"); \/\/ File | Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.\r\ntry {\r\nbyte[] result = apiInstance.convertToWebP(imageFile);\r\nSystem.out.println(result);\r\n} catch (ApiException e) {\r\nSystem.err.println(\"Exception when calling ConvertApi#convertToWebP\");\r\ne.printStackTrace();\r\n}\r\n<\/pre>\n\u6bcf\u4e2a API \u89e3\u51b3\u65b9\u6848\u90fd\u53ef\u4ee5\u4ece\u6570\u5341\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u683c\u5f0f\u8fdb\u884c\u8f6c\u6362\u3002\u4e3a\u4e86\u60a8\u7684\u65b9\u4fbf\uff0c\u6211\u5728\u8fd9\u91cc\u63d0\u4f9b\u4e86\u517c\u5bb9\u8f93\u5165\u683c\u5f0f\u7684\u5b8c\u6574\u5217\u8868\uff1a<\/p>\n
AAI\uff0c\u827a\u672f\uff0cARW\uff0cAVS\uff0cBPG\uff0cBMP\uff0cBMP2\uff0cBMP3\uff0cBRF\uff0cCALS\uff0cCGM\uff0cCIN\uff0cCMYK\uff0cCMYKA\uff0cCR2\uff0cCRW\uff0cCUR\uff0cCUT\uff0cDCM\uff0cDCR\uff0cDCX\uff0cDDS\uff0cDIB\uff0cDJVU\uff0cDNG\uff0c DOT\u3001DPX\u3001EMF\u3001EPDF\u3001EPI\u3001EPS\u3001EPS2\u3001EPS3\u3001EPSF\u3001EPSI\u3001EPT\u3001EXR\u3001FAX\u3001FIG\u3001FITS\u3001FPX\u3001GIF\u3001GPLT\u3001\u7070\u8272\u3001HDR\u3001HEIC\u3001HPGL\u3001HRZ\u3001ICO\u3001ISOBRL\u3001 ISBRL6\u3001JBIG\u3001JNG\u3001JP2\u3001JPT\u3001J2C\u3001J2K\u3001JPEG\/JPG\u3001JXR\u3001MAT\u3001MONO\u3001MNG\u3001M2V\u3001MRW\u3001MTV\u3001NEF\u3001ORF\u3001OTB\u3001P7\u3001PALM\u3001PAM\u3001PBM\u3001PCD\u3001PCDS\u3001 PCL\uff0cPCX\uff0cPDF\uff0cPEF\uff0cPES\uff0cPFA\uff0cPFB\uff0cPFM\uff0cPGM\uff0cPICON\uff0cPICT\uff0cPIX\uff0cPNG\uff0cPNG8\uff0cPNG00\uff0cPNG24\uff0cPNG32\uff0cPNG48\uff0cPNG64\uff0cPNM\uff0cPPM\uff0cPSB\uff0cPSD\uff0cPTIF\uff0cPWB\uff0c RAD\u3001RAF\u3001RGB\u3001RGB\u3001RGF\u3001RLA\u3001RLE\u3001SCT\u3001SFW\u3001SGI\u3001SID\u3001SUN\u3001SVG\u3001TGA\u3001TIFF\u3001TIM\u3001UIL\u3001VIFF\u3001VICAR\u3001VBMP\u3001WDP\u3001WEBP\u3001WPG\u3001X\u3001XBM\u3001 XCF\u3001XPM\u3001XWD\u3001X3F\u3001YCbCr\u3001YCbCrA\u3001YUV<\/p>\n","protected":false},"excerpt":{"rendered":"
\u4e86\u89e3\u5982\u4f55\u5c06\u6570\u5341\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u6587\u4ef6\u7c7b\u578b(\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e PNG \u548c JPG)\u5206\u522b\u8f6c\u6362\u4e3a GIF \u548c WebP \u683c\u5f0f\u3002 […]<\/p>\n","protected":false},"author":1898,"featured_media":256579,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[942],"class_list":["post-256569","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-webp"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/256569","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\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=256569"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/256569\/revisions"}],"predecessor-version":[{"id":257418,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/256569\/revisions\/257418"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/256579"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=256569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=256569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=256569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}