jpg 每像素位数
jpeg 中每个像素有多少位。我有一个 jpg,尺寸为 425 x 282,大小为 20635 字节。如果我将其编码为 png,则其大小为 116255 字节。
How many bits per pixel in a jpeg. I have a jpg which is 425 x 282 and its size is 20635 bytes. If i encode it to a png its 116255 bytes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一般答案:
每像素位数 = Bits/Pixel,1 字节 = 8 位
=> JPG(20635 * 8 位)/(425 * 282 像素)=>每像素 1,38 位
=> PNG(116255 * 8 位)/(425 * 282 像素)=>每像素 7,76 位
但请注意,您在这里将苹果与橙子进行比较。 PNG 是无损格式,而 JPG 会根据压缩强度而损失质量。对于不同的图像和两种格式的不同质量/压缩设置,每像素位数值会有所不同。
另外,请勿将其与用于颜色深度 在这两种情况下,图像的每像素应为 24 位(红色、绿色和蓝色各 8 位),尽管 PNG 使用 调色板(甚至使用 Alpha 通道)。
General answer:
Bits per pixel = Bits/Pixel, 1 Byte = 8 Bits
=> JPG (20635 * 8 bits) / (425 * 282 pixels) => 1,38 bits per pixel
=> PNG (116255 * 8 bits) / (425 * 282 pixels) => 7,76 bits per pixel
But note you're comparing apples to oranges here. PNG is a lossless format, while JPG loses quality depending on the compression strength. The bits per pixel value will vary for different images and different quality/compression settings for both formats.
Also, don't mix this with the term "bits per pixel" that is used for the color depth of an image which should be 24 bits per pixel (8 bits for each red, green and blue) in both cases, although PNG supports 8 bits per pixel using a color palette, too (or even 32 bits per pixel using an alpha channel).
如果您谈论的是颜色深度,我很想回答“24 位”和“RGB 或 CMYK”,但该规范似乎与所有规范一样复杂:
http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format
不过,这与文件大小关系不大。 JPEG 使用有损压缩算法,而 PNG 使用无损算法。这意味着如果编码为 PNG,JPEG 图片通常需要更大的文件。
If you are talking about colour depth, I'm tempted to answer "24-bit" and "RGB or CMYK", but the spec appears to be as complicate as all specs are:
http://en.wikipedia.org/wiki/JPEG_File_Interchange_Format
This has little to do with file size, though. JPEG uses a lossy compression algorithm while PNG uses lossless algorithms. That means that a JPEG picture will normally require a larger file if encoded as PNG.