是否有可能进一步COM preSS一个Base64 PNG字符串? [英] Is it possible to further compress a Base64 PNG String?

查看:172
本文介绍了是否有可能进一步COM preSS一个Base64 PNG字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PNG图像,并得到了它的Base64编码字符串,PNG重新presentation。它仍然是相当大的,我想知道,如果它可以显著进一步COM pressed。是,即使可能吗?

I have a PNG image and got its Base64 PNG string representation. It's still quite large and i'd like to know if it can be significantly further compressed. Is that even possible?

我使用Selenium 2(Java)来创建当前网页的截图,将其转换为base64字符串并发送字符串到JavaScript的执行者重新创建图像,并做一些图像处理。但是,如果该字符串大小太大,服务器返回一个异常。

I am using Selenium 2 (Java) to create a screenshot of the current web page, convert it as base64 string and send that string to the JavaScript executor to recreate that image and do some image processing. But if that string size is too large, the server returns an Exception.

推荐答案

简单的回答:不 - 没有松动的打印字符串自然

The simple answer: No - not without loosing the "printable string" nature

通常PNG已经使用了先进的COM pression像它在ZIP文件中使用。因此COM $ P $应用base64编码会给你只有极有限的尺寸缩小之前pssing它。

Usually PNG already uses sophisticated compression like it is used in ZIP files. Therefore compressing it before applying the base64 encoding will give you only very limited size reduction.

base64编码后运用COM pression将再次使它到二进制数据 - 在这种情况下,你可以只跳过base64编码步

Applying the compression after the base64 encoding will make it to binary data again - in this case you could just skip the base64 encoding step.

这篇关于是否有可能进一步COM preSS一个Base64 PNG字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆