Using ImageMagick to remove all color except black in an image?

后端 未结 3 1804
Happy的楠姐
Happy的楠姐 2020-12-14 12:14

The situation is : I have many images of documents from scanning. I want to keep the document\'s main content - which is printed in color black (a small range of colors arou

3条回答
  •  情深已故
    2020-12-14 12:49

    I stumbled upon this question while looking for an answer to this question. I found a couple imagemagick forum posts that helped. Here is what I came up with:

    convert input.gif -matte \( +clone -fuzz 1 -transparent black \) -compose DstOut -composite ~/Desktop/output.png
    

    Forum post: ImageMagick: Removing all but one color

提交回复
热议问题