我将让用户上传使用 JPEG 压缩的 300x300 图像。有没有办法确定此类图像的最大文件大小是多少?
我可以想象这可以通过以 100 质量压缩随机噪声来尝试,但是有理论上的最大值吗?
假设图像是完全不可压缩的随机噪声,它可以是每个像素 3 个字节(24 位颜色)和元数据的边距吗?或者这样的图像在压缩后会比原始图像更大吗?
来自维基百科: http://en.wikipedia.org/wiki/JPEG
For highest quality images (Q=100), about 8.25 bits per color pixel is required
http://en.wikipedia.org/wiki/JPEG#Sample_photographs http://en.wikipedia.org/wiki/JPEG#Sample_photographs
So, for Q=100
on an 300x300
图像,这将导致(300 * 300) px * 8.25 bits/px = 742,500 bits = ~ 93 kB
There are also lossless JPEG
coding modes, which are practically not used (last sentence, second paragraph http://en.wikipedia.org/wiki/JPEG#Typical_usage). But they would have the RGB typical 24 bits/pixel
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)