java imagemagick 灰度,如何在imagemagick中转换灰度bmp

我正在尝试将灰度PNG转换为具有以下属性的位图(BMP3版本):

Format: BMP3 (Microsoft Windows bitmap image (V3))

Class: PseudoClass

Type: Grayscale

Endianess: Undefined

Colorspace: Gray

Depth: 8-bit

Channel depth:

gray: 2-bit

问题是,我需要上面的特定配置(由identify-verbose test.bmp获取)由gimp生成,否则就是从imagemagick获得的配置。

Format: BMP3 (Microsoft Windows bitmap image (V3))

Class: PseudoClass

Type: Bilevel

Endianess: Undefined

Colorspace: Gray

Depth: 1-bit

Channel depth:

gray: 1-bit

把白色变成黑色。此图像正在发送到热敏打印机。

我用过以下方法:

convert test_tcl.png -colors 16 +dither -type bilevel BMP3:test.bmp

使用文件,我已经看到可以从设备正确打印的图像应该是以下格式:

$ file test_gimp3.bmp

test.bmp: PC bitmap, Windows 3.x format, 192 x 192 x 8

然而,我的是:

$ file test.bmp

test.bmp: PC bitmap, Windows 3.x format, 192 x 192 x 1

我怎样才能从上面产生(8位/2位)的输出?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值