【发布时间】:2023-04-08 09:15:01
【问题描述】:
如何在 Mac OS X 上确定 bmp 文件的位深度?特别是,我想检查 bmp 文件是否是真正的 24 位文件,或者它是否被保存为灰度(即 8 位)图像。我有一个黑白图像,我认为我已经强制为 24 位(使用 convert -type TrueColor),但 Imagemagick 给出了相互矛盾的结果:
> identify -verbose hiBW24.bmp
...
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: Gray
> identify -debug coder hiBW24.bmp
...
Bits per pixel: 24
许多其他命令行实用程序似乎没有帮助:
> file hi.bmp
hi.bmp: data
> exiv2 hiBW24.bmp
File name : hiBW24.bmp
File size : 286338 Bytes
MIME type : image/x-ms-bmp
Image size : 200 x 477
hiBW24.bmp: No Exif data found in the file
> mediainfo -f hi.bmp
...[nothing useful]
【问题讨论】:
-
挑剔:“灰度(即 8 位)”是错误的方法。 BMP 支持 8 位颜色索引格式,但这本身并不表示它是灰度的。这与支持两者的 PNG 不同。
标签: macos image-processing command-line imagemagick bmp