Last active
December 28, 2016 14:59
-
-
Save treyssatvincent/6af3f51f561df9aadcfff617473be6b9 to your computer and use it in GitHub Desktop.
black and white a lot of pictures (jpg, jpeg, png)
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
clean_extensionjpg(){ | |
mmv \*.[Jj][Pp][Gg] \#1.jpg | |
mmv \*.[Jj][Pp][Ee][Gg] \#1.jpg | |
} | |
clean_extensionpng(){ | |
mmv -v \*.[Pp][Nn][Gg] \#1.png | |
} | |
clean_extension(){ | |
clean_extensionpng | |
clean_extensionjpg | |
} | |
gray(){ | |
for img in $(find . -maxdepth 1 -iname '*'$1) | |
do | |
echo -n "Converting $img" | |
cp -f $img backup/$img | |
convert -colorspace GRAY $img $img && echo ' [Done]'; | |
done | |
} | |
mkdir backup | |
clean_extension | |
gray jpg | |
gray png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you should install mmv
(for debian :
apt-get install mmv
)