Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

ImageMagick みたび

$ convert -colors 256 hoge.bmp hoge256.bmp

とやった場合、実は出力の .BMP ファイルには RLE 圧縮がかかっている。convert(1) には次のような記述がある。

-compress type
the type of image compression: None, BZip, Fax, Group4, JPEG, LZW, RunlengthEncoded, or Zip.

Specify +compress to store the binary image in an uncompressed format. The default is the compression type of the specified image file.

$ convert -compress none -colors 256 hoge.bmp hoge256.bmp
$ convert +compress -colors 256 hoge.bmp hoge256.bmp

と、"-compress none" または "+compress" オプションをつけることで無圧縮にできる。