把图片变成字符串,怎么转最节省空间。什么进制字符串?

解决方案 »

  1.   

    听过把字符串转成图片的,没听过把图片变成字符串的
    你要节省看空间的话,直接用rar压缩呗
      

  2.   

    楼主是不是想要这样的
    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
    AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
    9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot">
      

  3.   

    差不多,你这是base64编码的吧。base64是最节省空间的编码方法吗?
      

  4.   

    维基百科有云
    Base64-encoded data URIs are 1/3 larger in size than their binary equivalent. (However, this overhead is reduced to 2-3% if the HTTP server compresses the response using gzip)
      

  5.   

    1/3 larger in size than their binary equivalent
    OK!