将tiff转换为模式1位图像

时间:2015-10-11 22:28:18

标签: image image-processing imagemagick tiff gimp

是否可以使用命令行工具将tiff图像转换为模式1位图像。我看到它可以用gimp完成,但我需要运行一个脚本,所以我更喜欢使用像imagemagick等软件包的解决方案

1 个答案:

答案 0 :(得分:3)

如果图像内容已经是黑白,并且您只需要转换,请使用:

convert input.tif -depth 1 output.tif

如果您还需要阈值图像,请使用以下内容:

convert input.tif -separate -black-threshold 128 -depth 1 output.tif