什么是灰度图像的BMP格式? [英] What is the BMP format for Gray scale Images?

查看:199
本文介绍了什么是灰度图像的BMP格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是灰度图像(尤其是每像素16位)的BMP格式?
维基百科只是彩色图像进行谈判BMP。

What is the BMP format for Gray scale Images (especially for 16 bit per pixel) ? The wikipedia just talks about colour images for bmp.

更新:

只是为了更新和未来访问者的信息,我打算 PGM作为这是uncom pressed,可以支持16位灰度。另一种选择是使用 PNG 的,但它的COM presses数据(这不是什么我想)所讨论的<一个href=\"http://stackoverflow.com/questions/11099931/trying-to-extract-pixel-values-from-a-given-png-image\">here 。
 另外请注意,图像可能会出现失真,因为大多数显示器都支持256色和4096 16位没有。因此图像会饱和。

Just for an update and information for future visitors, I am going for PGM as this is uncompressed and can support 16 bit gray-scale. Another option was to use PNG, but it compresses the data (which is not what I want) as discussed here . Also note that the image may appear distorted, since most of the monitors support 256 colors and not 4096 for 16 bit. So the Image will be saturated.

这是令人惊讶的,虽然知道是BMP的几乎的中灰度的情况下,16位图像无奈。结果
感谢的人谁帮助我理解这个问题。

It was though surprising to know that BMP is almost helpless in case of Gray-scale for 16 bit images.
Thanks for people who helped me understand the issue.

推荐答案

有关灰度图像,我会用8位BMP。 8位的BMP可以连接code调色板的颜色。但是,如果你不使用一个,你可以简单地间preT颜色值 [0 ... 255] 从黑色(0)到白色两种颜色( 255)。

For grayscale images, I would use 8-bit BMP. 8 bit BMPs can encode colors with palette. However, if you don't use one, you can simply interpret color values [0...255] as colors from black (0) to white (255).

编辑:我不会用BMP 16位灰度图像。从技术上讲,你可以使用每像素的BMP格式的16位编码的16位灰度数据(的http:/ /en.wikipedia.org/wiki/BMP_file_format#Pixel_format )。然而,在实践中,这是一个坏主意(读:哈克)。因为这深度被设计为EN code字母,像素的红色,绿色和蓝色的样品

I wouldn't use BMP for 16-bit grayscale images. Technically, you could use 16-bits per pixel BMP format for encoding 16-bit grayscale data (http://en.wikipedia.org/wiki/BMP_file_format#Pixel_format). However in practise this is a bad idea (read: hacky) since that depth is designed to encode alpha, red, green and blue samples of the pixels.

用于存储每个像素的灰度数据的16位更好的格式是PNG。

A better format for storing 16-bit per pixel grayscale data is PNG.

另外问一下自己,你真的,真的需要预算外资金precision?对于大多数应用程序,每像素8位还是蛮好的(=,如果你没有在precision任何具体的要求,这将是这种情况)。

Also ask yourself, do you really, really need that extra-precision? For most applications, 8 bits per pixel is just fine (=if you don't have any specific requirements on precision, this would be the case).

这篇关于什么是灰度图像的BMP格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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