Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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 "removed"
- else
- convert $file -bordercolor white -border 1x1 \
- -alpha set -channel RGBA -fuzz 10% \
- -fill none -floodfill +0+0 white \
- -shave 1x1 $file
- convert $file -channel rgba -alpha set -fuzz 10% -fill none -opaque white $file
- echo "converted"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement