从图像创建 64 进制字符串的开销?
我正在编写一个从图像到文本文件的基本 64 字符串,我得到的文件大小在 2-4 MB 之间,长度约为 50,000 行,这是正常的正常大小吗?
我正在用 Java 进行编程,之前没有以这种方式使用过 Base 64 或图像处理,只是想检查是否有办法使文件大小更小?
任何对此的帮助将不胜感激, 谢谢。
Im writing a base 64 string that i have made from an image to a text file and I'm getting files that are between 2-4 MBs and around 50,000 lines long is this normal a normal size?
I'm doing the programming in Java and have not worked with base 64 or image handling in this way before and just wanted to check if there was a way to make the file size smaller?
Any help with this would be greatly appreciated,
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Base64 引入了内容扩展,比率约为 4:3(即大小增加了 33%)。因此,假设图像文件的大小约为 Base64 文本文件大小的 75%,我会说是的,这是正常的。
没有任何好的方法可以在不压缩的情况下减小大小,这可能会引入二进制字节,从而使 Base64 编码首先毫无意义。
Base64 introduces content expansion, at an approximate rate of 4:3 (that's a 33% increase in size). So assuming the size of your image files is approximately 75% of the size of your base64 text files, I'd say yes, that's normal.
There isn't any good way to reduce the size without compressing them, which would likely introduce binary bytes, making the base64 encoding pointless in the first place.