Skip to content

Instantly share code, notes, and snippets.

@treyssatvincent
Last active December 28, 2016 14:59
Show Gist options
  • Save treyssatvincent/6af3f51f561df9aadcfff617473be6b9 to your computer and use it in GitHub Desktop.
Save treyssatvincent/6af3f51f561df9aadcfff617473be6b9 to your computer and use it in GitHub Desktop.
black and white a lot of pictures (jpg, jpeg, png)
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
@treyssatvincent
Copy link
Author

you should install mmv
(for debian : apt-get install mmv)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment