是否可以制作灰度BMP文件? [英] Is it possible to make a grayscale BMP file?

查看:70
本文介绍了是否可以制作灰度BMP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个将8位灰度图像输出到bmp文件的程序.我发现对8位BMP文件进行了索引.是否可以省略颜色表,而只将值而不是索引放在颜色表中?还是BMP格式不允许这样做?

I am trying to make a program that outputs a 8-bit grayscale image to bmp file. I have found out that 8-bit BMP files are indexed. Is it possible to omit the color table and just put values instead of indexes in the color table? Or BMP format does not allow this?

推荐答案

您仍然需要LUT,但是创建它非常简单.只有256个条目,其中红色,绿色和蓝色分量都等于灰度强度.

You still need the LUT but it's very simple to create it. It's just 256 entries where the red, green and blue components are all equal to the grey scale intensity.

这篇关于是否可以制作灰度BMP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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