문제

How can I use sips, imagemagic, or another tool to convert an image to black and white (grayscale) via the command line?

도움이 되었습니까?

해결책

If you have imagemagick installed,

convert source.jpg -colorspace Gray destination.jpg (true grayscale only)
convert source.jpg -monochrome destination.jpg (true black and white)
convert source.jpg -separate destination.jpg (separate into gray channels)

If you don't care about losing the original file: mogrify -colorspace Gray file.

다른 팁

use one of: -monochrome or -colorspace gray options for imagemagick (convert).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top