-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleaner.sh
39 lines (31 loc) · 864 Bytes
/
cleaner.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
store=$1
color=$2
if [[ $store != "appstore" && $store != "playstore" ]]; then
echo "store type must be appstore or playstore";
exit 1;
fi
if [[ $color != "black" && $color != "white" ]]; then
echo "color type must be black or white";
exit 1;
fi
locales=();
for png in $store/$color/*.png; do
locale=$(basename "${png%.png}");
locales+=("$locale");
done
target=_cleaned;
mkdir -p $target/$store/$color;
for locale in "${locales[@]}"; do
crop="";
if [[ $store == "appstore" ]]; then
crop="-crop +18+18 -crop -18-18";
elif [[ $store == "playstore" ]]; then
crop="-crop +10+10 -crop -10-10";
fi
convert $store/$color/$locale.png \
-trim +repage -gravity center \
$crop \
-channel rgba -alpha set -fill none -fuzz 10% -opaque "#000000" \
-trim +repage -gravity center \
$target/$store/$color/$locale.png;
done