如果JPEG为10MB,java.awt.Image将消耗多少内存? [英] How much memory will java.awt.Image consume if JPEG is 10MB?

查看:75
本文介绍了如果JPEG为10MB,java.awt.Image将消耗多少内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MTOM通常用于通过SOAP(附件)传输图像数据.该图像被映射到java.awt.Image(至少使用CXF). Image对象比实际传输的图像消耗更多的内存吗?假设传输的JPEG是10MB,那么Image对象会消耗多少空间?

MTOM is usually used to transfer image data over SOAP (attachments). The image is mapped to a java.awt.Image (at least with CXF). Does the Image object consume a lot more memory than the actual image transferred? Let's say a transferred JPEG is 10MB, how much more space will the Image object consume?

  • 更新- 我不太确定它与java.awt.Image有什么关系.此刻更多地关注CXF/MTOM:
  • UPDATE - I'm not so sure it has anything to do with java.awt.Image at all. Focusing on CXF/MTOM more at the moment: http://cxf.547215.n5.nabble.com/MTOM-large-attachments-eating-up-JVM-heap-td5714196.html

推荐答案

Image对象比实际传输的图像消耗更多的内存吗?

Does the Image object consume a lot more memory than the actual image transferred?

通常是.大多数文件格式的想法是压缩图像数据.

Typically yes. The idea of most of the file formats is to compress image data.

假设传输的JPEG为10MB,Image对象将消耗多少空间?

Let's say a transferred JPEG is 10MB, how much more space will the Image object consume?

RAM大小取决于W * H *'像素深度'.例如. 256个阴影的RGBA是每个像素4个字节. JPEG不支持alpha透明性,因此每个像素3个字节.

The RAM size depends on W * H * 'pixel depth'. E.G. RGBA in 256 shades is 4 bytes per pixel. JPEG does not support alpha transparency, so it would be 3 bytes per pixel.

有关不同级别JPEG压缩效率的有效性的一些概念,请参见此答案:

For some idea of the effectiveness of JPEG compression efficiency at different levels, see this answer:

这篇关于如果JPEG为10MB,java.awt.Image将消耗多少内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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