-
-
Save vencax/5db701818b7132824f50 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
for file in `find . -type f -iname "*.png"` | |
do | |
echo -n "processing $file ... " | |
isWhite=`convert $file -colorspace HSL -channel g -separate +channel -format "%[fx:mean]" info:` | |
if [ "$isWhite" == "0" ] | |
then | |
rm $file | |
echo "white $file removed" | |
else | |
# floodfill - to ne | |
#convert $file -bordercolor white -border 1x1 \ | |
# -alpha set -channel RGBA -fuzz 10% \ | |
# -fill none -floodfill +0+0 white \ | |
# -shave 1x1 $file | |
# smazani bile | |
convert $file -channel rgba -alpha set -fill none -opaque white $file | |
# smazani bile s toleranci | |
# convert $file -channel rgba -alpha set -fuzz 10% -fill none -opaque white $file | |
echo "converted" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment