Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How to convert the image with the following information: ColorType: truecolor Format: png bitDepth: 24
to a png grayscale image with bitdepth=8 in matlab ?
从文档中imwrite
imwrite
对于彩色图像,BitDepth 值是每个平面的位数
您要求 matlab 编写 3 个颜色通道,每个通道 8 位,结果为 24 位。如果要灰度,rgb2gray先用转成灰度,再写。
rgb2gray