Created
August 6, 2014 08:55
-
-
Save antonpirker/9836bcb9db928ef1a8d8 to your computer and use it in GitHub Desktop.
Convert all images in a directory tree recursively to gray scale and put them into out folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `find . -name "*.jpg"` | |
do | |
#echo "mkdir -p `echo out$f | xargs dirname | sed "s/\.\//\//"`" | |
mkdir -p `echo out$f | xargs dirname | sed "s/\.\//\//"` | |
#echo "convert $f -set colorspace Gray -separate -average `echo out$f | sed -e "s/\.\//\//"`" | |
convert $f -set colorspace Gray -separate -average `echo out$f | sed -e "s/\.\//\//"` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment