简体   繁体   中英

Converting tiff to mode 1 bit images

Is it possible to convert a tiff image to mode 1-bit image using command line tools. I saw it can be done with gimp but I need to run a script so I prefer a solution using packages like imagemagick etc

If the image contents is already black and white, and you just need to convert, use:

convert input.tif -depth 1 output.tif

If you also require to threshold the image, use something like:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM