画像ファイルを持っているが、その情報(size、depthなど)を調べるにはImageMagickというツールにあるidentify
コマンドを使う。
$ identify test.bmp
と実行すると
test.bmp BMP 320x240 320x240+0+0 1-bit sRGB 2c 9.73KB 0.000u 0:00.000
のように表示される。これでsize: 320x240, depth:1-bit などの情報がわかる。
さらに詳細な情報を知りたい場合は
$ identify -verbose test.bmp
と実行すると、以下のような内容が表示される。
Image: test.bmp
Format: BMP (Microsoft Windows bitmap image)
Class: PseudoClass
Geometry: 320x240+0+0
Units: PixelsPerCentimeter
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: Gray
Depth: 1-bit
Channel depth:
gray: 1-bit
(以下略)