volumetric-regimes-book/command-line/tools/make-images-bw.sh

11 lines
318 B
Bash
Raw Normal View History

2022-06-09 10:08:24 +02:00
# Read first argument from command line: input folder name
INPUT_DIR=$1
OUTPUT_DIR=$INPUT_DIR-bw
# Only make an output folder if it does not exist yet
mkdir -p $OUTPUT_DIR
for IMG in $(ls $INPUT_DIR); do
echo "$INPUT_DIR/$IMG ---> $OUTPUT_DIR/$IMG" && convert $INPUT_DIR/$IMG -colorspace Gray $OUTPUT_DIR/$IMG;
done