Convert entire folder to greyscale using image mag

2020-07-30 02:25发布

I am trying to convert an entire folder to grayscale, using image magick.

convert *.jpg -colorspace Gray -separate -average

is met with this error :

convert:  `-average' @ error/convert.c/ConvertImageCommand/3290.

What is the correct command for this?

1条回答
Emotional °昔
2楼-- · 2020-07-30 02:59

If you have lots of files to process, use mogrify:

magick mogrify -colorspace gray *.jpg

If you have tens of thousands of images and a multi-core CPU, you can get them all done in parallel with GNU Parallel:

parallel -X magick mogrify -colorspace gray ::: *.jpg
查看更多
登录 后发表回答