forked from jdf2e/jdc_fe_guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0e2f6de8.513e8e6a.js
1 lines (1 loc) · 14.4 KB
/
0e2f6de8.513e8e6a.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{140:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return l})),r.d(t,"metadata",(function(){return c})),r.d(t,"rightToc",(function(){return i})),r.d(t,"default",(function(){return o}));var n=r(2),b=r(9),a=(r(0),r(199)),l={title:"\u56fe\u7247\u683c\u5f0f"},c={id:"image/format",title:"\u56fe\u7247\u683c\u5f0f",description:"## \u56fe\u7247\u683c\u5f0f",source:"@site/docs/image/format.md",permalink:"/jdc_fe_guide/docs/image/format",editUrl:"https://git.jd.com/JDC_FE/jdc_fe_guide/tree/master/docs/image/format.md",sidebar:"someSidebar",previous:{title:"WebApp Meta",permalink:"/jdc_fe_guide/docs/html/webapp"},next:{title:"\u56fe\u7247\u5927\u5c0f",permalink:"/jdc_fe_guide/docs/image/size"}},i=[{value:"\u56fe\u7247\u683c\u5f0f",id:"\u56fe\u7247\u683c\u5f0f",children:[{value:"GIF",id:"gif",children:[]},{value:"PNG",id:"png",children:[]},{value:"JPEG",id:"jpeg",children:[]},{value:"WEBP",id:"webp",children:[]}]},{value:"\u56e2\u961f\u7ea6\u5b9a",id:"\u56e2\u961f\u7ea6\u5b9a",children:[{value:"\u5185\u5bb9\u56fe",id:"\u5185\u5bb9\u56fe",children:[]},{value:"\u80cc\u666f\u56fe",id:"\u80cc\u666f\u56fe",children:[]}]}],p={rightToc:i};function o(e){var t=e.components,r=Object(b.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"\u56fe\u7247\u683c\u5f0f"},"\u56fe\u7247\u683c\u5f0f"),Object(a.b)("p",null,"\u5e38\u89c1\u7684\u56fe\u7247\u683c\u5f0f\u6709 GIF\u3001PNG8\u3001PNG24\u3001JPEG\u3001WEBP\uff0c\u6839\u636e\u56fe\u7247\u683c\u5f0f\u7684\u7279\u6027\u548c\u573a\u666f\u9700\u8981\u9009\u53d6\u9002\u5408\u7684\u56fe\u7247\u683c\u5f0f\u3002"),Object(a.b)("h3",{id:"gif"},"GIF"),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},"GIF\u56fe\u8c61\u662f\u57fa\u4e8e\u989c\u8272\u5217\u8868\u7684\uff08\u5b58\u50a8\u7684\u6570\u636e\u662f\u8be5\u70b9\u7684\u989c\u8272\u5bf9\u5e94\u4e8e\u989c\u8272\u5217\u8868\u7684\u7d22\u5f15\u503c\uff09\uff0c\u6700\u591a\u53ea\u652f\u63018\u4f4d\uff08256\u8272\uff09\u3002GIF\u6587\u4ef6\u5185\u90e8\u5206\u6210\u8bb8\u591a\u5b58\u50a8\u5757\uff0c\u7528\u6765\u5b58\u50a8\u591a\u5e45\u56fe\u8c61\u6216\u8005\u662f\u51b3\u5b9a\u56fe\u8c61\u8868\u73b0\u884c\u4e3a\u7684\u63a7\u5236\u5757\uff0c\u7528\u4ee5\u5b9e\u73b0\u52a8\u753b\u548c\u4ea4\u4e92\u5f0f\u5e94\u7528\u3002GIF\u6587\u4ef6\u8fd8\u901a\u8fc7LZW\u538b\u7f29\u7b97\u6cd5\u538b\u7f29\u56fe\u8c61\u6570\u636e\u6765\u51cf\u5c11\u56fe\u8c61\u5c3a\u5bf8")),Object(a.b)("h4",{id:"\u7279\u6027"},"\u7279\u6027"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u4f18\u79c0\u7684\u538b\u7f29\u7b97\u6cd5\u4f7f\u5176\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4fdd\u8bc1\u56fe\u50cf\u8d28\u91cf\u7684\u540c\u65f6\u5c06\u4f53\u79ef\u53d8\u5f97\u5f88\u5c0f\u3002"),Object(a.b)("li",{parentName:"ul"},"\u53ef\u63d2\u5165\u591a\u5e27\uff0c\u4ece\u800c\u5b9e\u73b0\u52a8\u753b\u6548\u679c\u3002"),Object(a.b)("li",{parentName:"ul"},"\u53ef\u8bbe\u7f6e\u900f\u660e\u8272\u4ee5\u4ea7\u751f\u5bf9\u8c61\u6d6e\u73b0\u4e8e\u80cc\u666f\u4e4b\u4e0a\u7684\u6548\u679c\u3002"),Object(a.b)("li",{parentName:"ul"},"\u7531\u4e8e\u91c7\u7528\u4e868\u4f4d\u538b\u7f29\uff0c\u6700\u591a\u53ea\u80fd\u5904\u7406256\u79cd\u989c\u8272\uff0c\u6545\u4e0d\u5b9c\u5e94\u7528\u4e8e\u771f\u5f69\u8272\u56fe\u7247\u3002")),Object(a.b)("p",null,"\u66f4\u591a\u5173\u4e8eGIF\uff1a"),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://zh.wikipedia.org/wiki/GIF"}),"\u7ef4\u57fa\u767e\u79d1 - GIF")),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"http://dev.gameres.com/Program/Visual/Other/GIFDoc.htm"}),"GIF\u6587\u6863")),Object(a.b)("h3",{id:"png"},"PNG"),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},"PNG\u662f20\u4e16\u7eaa90\u5e74\u4ee3\u4e2d\u671f\u5f00\u59cb\u5f00\u53d1\u7684\u56fe\u50cf\u6587\u4ef6\u5b58\u50a8\u683c\u5f0f\uff0c\u5176\u76ee\u7684\u662f\u4f01\u56fe\u66ff\u4ee3GIF\u548cTIFF\u6587\u4ef6\u683c\u5f0f\uff0c\u540c\u65f6\u589e\u52a0\u4e00\u4e9bGIF\u6587\u4ef6\u683c\u5f0f\u6240\u4e0d\u5177\u5907\u7684\u7279\u6027\u3002\u6d41\u5f0f\u7f51\u7edc\u56fe\u5f62\u683c\u5f0f(Portable Network Graphic Format\uff0cPNG)\u540d\u79f0\u6765\u6e90\u4e8e\u975e\u5b98\u65b9\u7684\u201cPNG's Not GIF\u201d\uff0c\u662f\u4e00\u79cd\u4f4d\u56fe\u6587\u4ef6(bitmap file)\u5b58\u50a8\u683c\u5f0f\uff0c\u8bfb\u6210\u201cping\u201d\u3002PNG\u7528\u6765\u5b58\u50a8\u7070\u5ea6\u56fe\u50cf\u65f6\uff0c\u7070\u5ea6\u56fe\u50cf\u7684\u6df1\u5ea6\u53ef\u591a\u523016\u4f4d\uff0c\u5b58\u50a8\u5f69\u8272\u56fe\u50cf\u65f6\uff0c\u5f69\u8272\u56fe\u50cf\u7684\u6df1\u5ea6\u53ef\u591a\u523048\u4f4d\uff0c\u5e76\u4e14\u8fd8\u53ef\u5b58\u50a8\u591a\u523016\u4f4d\u7684\u03b1\u901a\u9053\u6570\u636e\u3002PNG\u4f7f\u7528\u4eceLZ77\u6d3e\u751f\u7684\u65e0\u635f\u6570\u636e\u538b\u7f29\u7b97\u6cd5\u3002")),Object(a.b)("h4",{id:"\u7279\u6027-1"},"\u7279\u6027"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u652f\u6301256\u8272\u8c03\u8272\u677f\u6280\u672f\uff0c\u6587\u4ef6\u4f53\u79ef\u5c0f\u3002"),Object(a.b)("li",{parentName:"ul"},"\u65e0\u635f\u538b\u7f29"),Object(a.b)("li",{parentName:"ul"},"\u6700\u9ad8\u652f\u630148\u4f4d\u771f\u5f69\u8272\u56fe\u50cf\u4ee5\u53ca16\u4f4d\u7070\u5ea6\u56fe\u50cf\u3002"),Object(a.b)("li",{parentName:"ul"},"\u652f\u6301Alpha\u901a\u9053\u7684\u900f\u660e/\u534a\u900f\u660e\u7279\u6027\u3002"),Object(a.b)("li",{parentName:"ul"},"\u652f\u6301\u56fe\u50cf\u4eae\u5ea6\u7684Gamma\u6821\u51c6\u4fe1\u606f\u3002"),Object(a.b)("li",{parentName:"ul"},"\u652f\u6301\u5b58\u50a8\u9644\u52a0\u6587\u672c\u4fe1\u606f\uff0c\u4ee5\u4fdd\u7559\u56fe\u50cf\u540d\u79f0\u3001\u4f5c\u8005\u3001\u7248\u6743\u3001\u521b\u4f5c\u65f6\u95f4\u3001\u6ce8\u91ca\u7b49\u4fe1\u606f\u3002"),Object(a.b)("li",{parentName:"ul"},"\u6e10\u8fd1\u663e\u793a\u548c\u6d41\u5f0f\u8bfb\u5199\uff0c\u9002\u5408\u5728\u7f51\u7edc\u4f20\u8f93\u4e2d\u5feb\u901f\u663e\u793a\u9884\u89c8\u6548\u679c\u540e\u518d\u5c55\u793a\u5168\u8c8c\u3002"),Object(a.b)("li",{parentName:"ul"},"\u4f7f\u7528CRC\u9632\u6b62\u6587\u4ef6\u51fa\u9519\u3002"),Object(a.b)("li",{parentName:"ul"},"\u6700\u65b0\u7684PNG\u6807\u51c6\u5141\u8bb8\u5728\u4e00\u4e2a\u6587\u4ef6\u5185\u5b58\u50a8\u591a\u5e45\u56fe\u50cf\u3002")),Object(a.b)("p",null,"\u66f4\u591a\u5173\u4e8ePNG\uff1a"),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"http://www.libpng.org/pub/png/"}),"PNG\u5b98\u65b9\u7ad9 - PNG General Information")),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"http://dev.gameres.com/Program/Visual/Other/PNGFormat.htm"}),"PNG\u683c\u5f0f")),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://zh.wikipedia.org/wiki/PNG"}),"\u7ef4\u57fa\u767e\u79d1 - PNG")),Object(a.b)("h3",{id:"jpeg"},"JPEG"),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},"JPEG\u662f\u4e00\u79cd\u9488\u5bf9\u7167\u7247\u89c6\u9891\u800c\u5e7f\u6cdb\u4f7f\u7528\u7684\u4e00\u79cd\u6709\u635f\u538b\u7f29\u6807\u51c6\u65b9\u6cd5\u3002\u8fd9\u4e2a\u540d\u79f0\u4ee3\u8868Joint Photographic Experts Group\uff08\u8054\u5408\u56fe\u50cf\u4e13\u5bb6\u5c0f\u7ec4\uff09\u3002\u6b64\u56e2\u961f\u521b\u7acb\u4e8e\u516c\u51431986\u5e74\uff0c1992\u5e74\u53d1\u5e03\u4e86JPEG\u7684\u6807\u51c6\u800c\u57281994\u5e74\u83b7\u5f97\u4e86ISO 10918-1\u7684\u8ba4\u5b9a")),Object(a.b)("h4",{id:"\u7279\u6027-2"},"\u7279\u6027"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u9002\u7528\u4e8e\u50a8\u5b5824\u4f4d\u5143\u5168\u91c7\u5f71\u50cf"),Object(a.b)("li",{parentName:"ul"},"\u91c7\u53d6\u7684\u538b\u7f29\u65b9\u5f0f\u901a\u5e38\u4e3a\u6709\u635f\u538b\u7f29"),Object(a.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u900f\u660e\u6216\u52a8\u753b"),Object(a.b)("li",{parentName:"ul"},"\u538b\u7f29\u6bd4\u8d8a\u9ad8\u5f71\u50cf\u8017\u635f\u8d8a\u5927\uff0c\u5931\u771f\u8d8a\u4e25\u91cd"),Object(a.b)("li",{parentName:"ul"},"\u538b\u7f29\u6bd4\u572810\u5de6\u53f3\u8089\u773c\u65e0\u6cd5\b\u8fa8\u51fa\u538b\u7f29\u56fe\u4e0e\u539f\u56fe\u7684\u5dee\u522b")),Object(a.b)("p",null,"\u66f4\u591a\u5173\u4e8eJPEG\uff1a"),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://zh.wikipedia.org/wiki/JPEG"}),"\u7ef4\u57fa\u767e\u79d1 - JPEG")),Object(a.b)("h3",{id:"webp"},"WEBP"),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},"WebP\uff0c\u662f\u4e00\u79cd\u540c\u65f6\u63d0\u4f9b\u4e86\u6709\u635f\u538b\u7f29\u4e0e\u65e0\u635f\u538b\u7f29\u7684\u56fe\u7247\u6587\u4ef6\u683c\u5f0f\uff0c\u6d3e\u751f\u81ea\u89c6\u9891\u7f16\u7801\u683c\u5f0f VP8\uff0c\u662f\u7531Google\u5728\u8d2d\u4e70On2 Technologies\u540e\u53d1\u5c55\u51fa\u6765\u3002WebP\u6700\u521d\u57282010\u5e74\u53d1\u5e03\uff0c2011\u5e7411\u67088\u65e5\uff0cGoogle\u5f00\u59cb\u8ba9WebP\u652f\u6301\u65e0\u635f\u538b\u7f29\u548c\u900f\u660e\u8272\u7684\u529f\u80fd\uff0c\u800c\u57282012\u5e748\u670816\u65e5\u7684\u53c2\u8003\u5b9e\u505alibwebp 0.2.0\u4e2d\u6b63\u5f0f\u652f\u6301")),Object(a.b)("h4",{id:"\u7279\u6027-3"},"\u7279\u6027"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u540c\u65f6\u63d0\u4f9b\u6709\u635f\u538b\u7f29\u548c\u65e0\u635f\u538b\u7f29\u4e24\u79cd\u56fe\u7247\u6587\u4ef6\u683c\u5f0f"),Object(a.b)("li",{parentName:"ul"},"\u6587\u4ef6\u4f53\u79ef\u5c0f\uff0c\u65e0\u635f\u538b\u7f29\u540e\uff0c\u6bd4 PNG \u6587\u4ef6\u5c11\u4e86 45\uff05 \u7684\u6587\u4ef6\u5927\u5c0f\uff1b\u6709\u635f\u538b\u7f29\u540e\uff0c\u6bd4 JPEG \u6587\u4ef6\u5c11\u4e86 25% - 34% \u6587\u4ef6\u5927\u5c0f"),Object(a.b)("li",{parentName:"ul"},"\u6d4f\u89c8\u5668\u517c\u5bb9\u5dee\uff0c\u76ee\u524d\u53ea\u652f\u6301\u5ba2\u6237\u7aef Chrome \u548c Opera \u6d4f\u89c8\u5668\u4ee5\u53ca\u5b89\u5353\u539f\u751f\u6d4f\u89c8\u5668(Andriod 4.0+)\uff0c",Object(a.b)("a",Object(n.a)({parentName:"li"},{href:"https://developers.google.com/speed/webp/faq#which_web_browsers_natively_support_webp"}),"WebP\u517c\u5bb9\u6027"))),Object(a.b)("p",null,"\u66f4\u591a\u5173\u4e8eWebP\uff1a"),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://zh.wikipedia.org/wiki/WebP"}),"\u7ef4\u57fa\u767e\u79d1 - WEBP")),Object(a.b)("p",null,Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"http://isux.tencent.com/introduction-of-webp.html"}),"WEBP\u63a2\u5bfb\u4e4b\u8def")),Object(a.b)("h2",{id:"\u56e2\u961f\u7ea6\u5b9a"},"\u56e2\u961f\u7ea6\u5b9a"),Object(a.b)("h3",{id:"\u5185\u5bb9\u56fe"},"\u5185\u5bb9\u56fe"),Object(a.b)("p",null,"\u5185\u5bb9\u56fe\u591a\u4ee5\u5546\u54c1\u56fe\u7b49\u7167\u7247\u7c7b\u56fe\u7247\u5f62\u5f0f\u5b58\u5728\uff0c\u989c\u8272\u8f83\u4e3a\u4e30\u5bcc\uff0c\u6587\u4ef6\u4f53\u79ef\u8f83\u5927"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u4f18\u5148\u8003\u8651 JPEG \u683c\u5f0f\uff0c\u6761\u4ef6\u5141\u8bb8\u7684\u8bdd\u4f18\u5148\u8003\u8651 WebP \u683c\u5f0f"),Object(a.b)("li",{parentName:"ul"},"\u5c3d\u91cf\u4e0d\u4f7f\u7528PNG\u683c\u5f0f\uff0cPNG8 \u8272\u4f4d\u592a\u4f4e\uff0cPNG24 \u538b\u7f29\u7387\u4f4e\uff0c\u6587\u4ef6\u4f53\u79ef\u5927")),Object(a.b)("h3",{id:"\u80cc\u666f\u56fe"},"\u80cc\u666f\u56fe"),Object(a.b)("p",null,"\u80cc\u666f\u56fe\u591a\u4e3a\u56fe\u6807\u7b49\u989c\u8272\u6bd4\u8f83\u7b80\u5355\u3001\u6587\u4ef6\u4f53\u79ef\u4e0d\u5927\u3001\u8d77\u4fee\u9970\u4f5c\u7528\u7684\u56fe\u7247"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"PNG \u4e0e GIF \u683c\u5f0f\uff0c\u4f18\u5148\u8003\u8651\u4f7f\u7528 PNG \u683c\u5f0f,PNG\u683c\u5f0f\u5141\u8bb8\u66f4\u591a\u7684\u989c\u8272\u5e76\u63d0\u4f9b\u66f4\u597d\u7684\u538b\u7f29\u7387"),Object(a.b)("li",{parentName:"ul"},"\u56fe\u50cf\u989c\u8272\u6bd4\u8f83\u7b80\u5355\u7684\uff0c\u5982\u7eaf\u8272\u5757\u7ebf\u6761\u56fe\u6807\uff0c\u4f18\u5148\u8003\u8651\u4f7f\u7528 PNG8 \u683c\u5f0f\uff0c\u907f\u514d\u4e0d\u4f7f\u7528 JPEG \u683c\u5f0f"),Object(a.b)("li",{parentName:"ul"},"\u56fe\u50cf\u989c\u8272\u4e30\u5bcc\u800c\u4e14\u56fe\u7247\u6587\u4ef6\u4e0d\u592a\u5927\u7684\uff0840KB \u4ee5\u4e0b\uff09\u6216\u6709\u534a\u900f\u660e\u6548\u679c\u7684\u4f18\u5148\u8003\u8651 PNG24 \u683c\u5f0f"),Object(a.b)("li",{parentName:"ul"},"\u56fe\u50cf\u989c\u8272\u4e30\u5bcc\u800c\u4e14\u6587\u4ef6\u6bd4\u8f83\u5927\u7684\uff0840KB - 200KB\uff09\u4f18\u5148\u8003\u8651 JPEG \u683c\u5f0f"),Object(a.b)("li",{parentName:"ul"},"\u6761\u4ef6\u5141\u8bb8\u7684\uff0c\u4f18\u5148\u8003\u8651 WebP \u4ee3\u66ff PNG \u548c JPEG \u683c\u5f0f")))}o.isMDXComponent=!0},199:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return m}));var n=r(0),b=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t){if(null==e)return{};var r,n,b=function(e,t){if(null==e)return{};var r,n,b={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(b[r]=e[r]);return b}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(b[r]=e[r])}return b}var p=b.a.createContext({}),o=function(e){var t=b.a.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):c({},t,{},e)),r},u=function(e){var t=o(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},O={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},j=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,l=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=o(r),j=n,m=u["".concat(l,".").concat(j)]||u[j]||O[j]||a;return r?b.a.createElement(m,c({ref:t},p,{components:r})):b.a.createElement(m,c({ref:t},p))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,l=new Array(a);l[0]=j;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c.mdxType="string"==typeof e?e:n,l[1]=c;for(var p=2;p<a;p++)l[p]=r[p];return b.a.createElement.apply(null,l)}return b.a.createElement.apply(null,r)}j.displayName="MDXCreateElement"}}]);